]> Git Repo - linux.git/commitdiff
block: use memzero_page in zero_fill_bio
authorChristoph Hellwig <[email protected]>
Tue, 27 Jul 2021 05:56:36 +0000 (07:56 +0200)
committerJens Axboe <[email protected]>
Mon, 2 Aug 2021 19:37:27 +0000 (13:37 -0600)
Use memzero_bvec to zero each segment in the bio instead of manually
mapping and zeroing the data.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
block/bio.c

index 1fab762e079be5ab0c1e41d67701209c8ddf3af9..2e436bccb1e24c8be64968ffeb2b71047a4f7e67 100644 (file)
@@ -495,16 +495,11 @@ EXPORT_SYMBOL(bio_kmalloc);
 
 void zero_fill_bio(struct bio *bio)
 {
-       unsigned long flags;
        struct bio_vec bv;
        struct bvec_iter iter;
 
-       bio_for_each_segment(bv, bio, iter) {
-               char *data = bvec_kmap_irq(&bv, &flags);
-               memset(data, 0, bv.bv_len);
-               flush_dcache_page(bv.bv_page);
-               bvec_kunmap_irq(data, &flags);
-       }
+       bio_for_each_segment(bv, bio, iter)
+               memzero_bvec(&bv);
 }
 EXPORT_SYMBOL(zero_fill_bio);
 
This page took 0.057933 seconds and 4 git commands to generate.