aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorGravatar Christoph Hellwig <hch@lst.de> 2021-10-19 15:44:05 +0200
committerGravatar Mike Snitzer <snitzer@redhat.com> 2021-11-01 13:28:47 -0400
commit27db2717085198862a5b96dc8f00e527bf45c950 (patch)
treebc5b8f6b764b5a22d6b5e73914a34bf4a43aebc3 /drivers/md
parentdm integrity: use bvec_kmap_local in __journal_read_write (diff)
downloadlinux-27db2717085198862a5b96dc8f00e527bf45c950.tar.gz
linux-27db2717085198862a5b96dc8f00e527bf45c950.tar.bz2
linux-27db2717085198862a5b96dc8f00e527bf45c950.zip
dm log writes: use memcpy_from_bvec in log_writes_map
Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-log-writes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c
index d93a4db23512..eeaf729287f0 100644
--- a/drivers/md/dm-log-writes.c
+++ b/drivers/md/dm-log-writes.c
@@ -753,7 +753,7 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio)
*/
bio_for_each_segment(bv, bio, iter) {
struct page *page;
- void *src, *dst;
+ void *dst;
page = alloc_page(GFP_NOIO);
if (!page) {
@@ -765,11 +765,9 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_KILL;
}
- src = kmap_atomic(bv.bv_page);
dst = kmap_atomic(page);
- memcpy(dst, src + bv.bv_offset, bv.bv_len);
+ memcpy_from_bvec(dst, &bv);
kunmap_atomic(dst);
- kunmap_atomic(src);
block->vecs[i].bv_page = page;
block->vecs[i].bv_len = bv.bv_len;
block->vec_cnt++;