Skip to content

Commit 27db271

Browse files
Christoph Hellwigsnitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 25058d1 commit 27db271

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/md/dm-log-writes.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio)
753753
*/
754754
bio_for_each_segment(bv, bio, iter) {
755755
struct page *page;
756-
void *src, *dst;
756+
void *dst;
757757

758758
page = alloc_page(GFP_NOIO);
759759
if (!page) {
@@ -765,11 +765,9 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio)
765765
return DM_MAPIO_KILL;
766766
}
767767

768-
src = kmap_atomic(bv.bv_page);
769768
dst = kmap_atomic(page);
770-
memcpy(dst, src + bv.bv_offset, bv.bv_len);
769+
memcpy_from_bvec(dst, &bv);
771770
kunmap_atomic(dst);
772-
kunmap_atomic(src);
773771
block->vecs[i].bv_page = page;
774772
block->vecs[i].bv_len = bv.bv_len;
775773
block->vec_cnt++;

0 commit comments

Comments
 (0)