diff options
author | Christoph Hellwig <hch@lst.de> | 2021-07-27 07:56:36 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-02 21:37:27 +0200 |
commit | ab6c340eeac426fb649ddb4f23b7c752f0092204 (patch) | |
tree | 65ba9cec4057066f2b2984b12e224b6e1db26ce6 /block/bio.c | |
parent | bvec: add memcpy_{from,to}_bvec and memzero_bvec helper (diff) | |
download | linux-ab6c340eeac426fb649ddb4f23b7c752f0092204.tar.xz linux-ab6c340eeac426fb649ddb4f23b7c752f0092204.zip |
block: use memzero_page in zero_fill_bio
Use memzero_bvec to zero each segment in the bio instead of manually
mapping and zeroing the data.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20210727055646.118787-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | block/bio.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/block/bio.c b/block/bio.c index 1fab762e079b..2e436bccb1e2 100644 --- a/block/bio.c +++ b/block/bio.c @@ -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); |