]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bio: use memzero_page() in bio_truncate()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 12 Jun 2025 14:34:37 +0000 (15:34 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:42:08 +0000 (22:42 -0700)
Patch series "Remove zero_user()".

The zero_user() API is almost unused these days.  Finish the job of
removing it.

This patch (of 5):

memzero_page() is the new name for zero_user().

Link: https://lkml.kernel.org/r/20250612143443.2848197-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20250612143443.2848197-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Xiubo Li <xiubli@redhat.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
block/bio.c

index 3c0a558c90f52eef5f4c34b25e34bd6f0d9ed9d8..ce16c34ec6de6363c1c14d940f44b0c6a1d368fd 100644 (file)
@@ -653,13 +653,13 @@ static void bio_truncate(struct bio *bio, unsigned new_size)
 
        bio_for_each_segment(bv, bio, iter) {
                if (done + bv.bv_len > new_size) {
-                       unsigned offset;
+                       size_t offset;
 
                        if (!truncated)
                                offset = new_size - done;
                        else
                                offset = 0;
-                       zero_user(bv.bv_page, bv.bv_offset + offset,
+                       memzero_page(bv.bv_page, bv.bv_offset + offset,
                                  bv.bv_len - offset);
                        truncated = true;
                }