brd: use bvec_kmap_local in brd_do_bvec

Use the proper helper to kmap a bvec in brd_do_bvec instead of directly
accessing the bvec fields and use the deprecated kmap_atomic API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20250428141014.2360063-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2025-04-28 07:09:49 -07:00 committed by Jens Axboe
parent 857aba38b5
commit 95a375a3be

View File

@ -207,15 +207,15 @@ static int brd_rw_bvec(struct brd_device *brd, struct bio_vec *bv,
return err;
}
mem = kmap_atomic(bv->bv_page);
mem = bvec_kmap_local(bv);
if (!op_is_write(opf)) {
copy_from_brd(mem + bv->bv_offset, brd, sector, bv->bv_len);
copy_from_brd(mem, brd, sector, bv->bv_len);
flush_dcache_page(bv->bv_page);
} else {
flush_dcache_page(bv->bv_page);
copy_to_brd(brd, mem + bv->bv_offset, sector, bv->bv_len);
copy_to_brd(brd, mem, sector, bv->bv_len);
}
kunmap_atomic(mem);
kunmap_local(mem);
return 0;
}