summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-03-03 12:18:58 +0100
committerJens Axboe <axboe@kernel.dk>2022-03-04 20:29:20 +0100
commitb3bd0a8a74ab970cc1cf0849e66bd0906741105b (patch)
tree91acd1e521e2f88506b03171488b638bcf1df7ca /drivers/block
parentaoe: use bvec_kmap_local in bvcpy (diff)
downloadlinux-b3bd0a8a74ab970cc1cf0849e66bd0906741105b.tar.xz
linux-b3bd0a8a74ab970cc1cf0849e66bd0906741105b.zip
zram: use memcpy_to_bvec in zram_bvec_read
Use the proper helper instead of open coding the copy. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20220303111905.321089-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/zram/zram_drv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index a3a5e1e71326..14becdf2815d 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1331,12 +1331,10 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
goto out;
if (is_partial_io(bvec)) {
- void *dst = kmap_atomic(bvec->bv_page);
void *src = kmap_atomic(page);
- memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len);
+ memcpy_to_bvec(bvec, src + offset);
kunmap_atomic(src);
- kunmap_atomic(dst);
}
out:
if (is_partial_io(bvec))