Commit 58dfe140 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

vringh: use bvec_set_page to initialize a bvec

Use the bvec_set_page helper to initialize a bvec.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-23-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 9088151f
......@@ -1126,9 +1126,8 @@ static int iotlb_translate(const struct vringh *vrh,
size = map->size - addr + map->start;
pa = map->addr + addr - map->start;
pfn = pa >> PAGE_SHIFT;
iov[ret].bv_page = pfn_to_page(pfn);
iov[ret].bv_len = min(len - s, size);
iov[ret].bv_offset = pa & (PAGE_SIZE - 1);
bvec_set_page(&iov[ret], pfn_to_page(pfn), min(len - s, size),
pa & (PAGE_SIZE - 1));
s += size;
addr += size;
++ret;
......
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