[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210727055646.118787-7-hch@lst.de>
Date: Tue, 27 Jul 2021 07:56:37 +0200
From: Christoph Hellwig <hch@....de>
To: Jens Axboe <axboe@...nel.dk>, Thomas Gleixner <tglx@...utronix.de>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Geoff Levand <geoff@...radead.org>,
Ilya Dryomov <idryomov@...il.com>,
Dongsheng Yang <dongsheng.yang@...ystack.cn>,
Mike Snitzer <snitzer@...hat.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
Ira Weiny <ira.weiny@...el.com>, dm-devel@...hat.com,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-block@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
ceph-devel@...r.kernel.org, linux-arch@...r.kernel.org,
"Martin K . Petersen" <martin.petersen@...cle.com>
Subject: [PATCH 06/15] rbd: use memzero_bvec
Use memzero_bvec instead of reimplementing it.
Signed-off-by: Christoph Hellwig <hch@....de>
Acked-by: Ilya Dryomov <idryomov@...il.com>
Reviewed-by: Martin K. Petersen <martin.petersen@...cle.com>
Reviewed-by: Ira Weiny <ira.weiny@...el.com>
---
drivers/block/rbd.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 90b947c96402..6d596c2c2cd6 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1219,24 +1219,13 @@ static void rbd_dev_mapping_clear(struct rbd_device *rbd_dev)
rbd_dev->mapping.size = 0;
}
-static void zero_bvec(struct bio_vec *bv)
-{
- void *buf;
- unsigned long flags;
-
- buf = bvec_kmap_irq(bv, &flags);
- memset(buf, 0, bv->bv_len);
- flush_dcache_page(bv->bv_page);
- bvec_kunmap_irq(buf, &flags);
-}
-
static void zero_bios(struct ceph_bio_iter *bio_pos, u32 off, u32 bytes)
{
struct ceph_bio_iter it = *bio_pos;
ceph_bio_iter_advance(&it, off);
ceph_bio_iter_advance_step(&it, bytes, ({
- zero_bvec(&bv);
+ memzero_bvec(&bv);
}));
}
@@ -1246,7 +1235,7 @@ static void zero_bvecs(struct ceph_bvec_iter *bvec_pos, u32 off, u32 bytes)
ceph_bvec_iter_advance(&it, off);
ceph_bvec_iter_advance_step(&it, bytes, ({
- zero_bvec(&bv);
+ memzero_bvec(&bv);
}));
}
--
2.30.2
Powered by blists - more mailing lists