Commit b3bd0a8a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

zram: use memcpy_to_bvec in zram_bvec_read

Use the proper helper instead of open coding the copy.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Link: https://lore.kernel.org/r/20220303111905.321089-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b7ab4611
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment