diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-03 18:06:33 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-03 20:17:42 +0300 |
commit | 58dfe14073846e416d5b3595314a4f37e1a89c50 (patch) | |
tree | 48eb96e351cb0eafa89d6be8ee964a1c36545257 /drivers/vhost | |
parent | 9088151f1bfe670ae9e28b77095f974196bb2343 (diff) | |
download | linux-58dfe14073846e416d5b3595314a4f37e1a89c50.tar.xz |
vringh: use bvec_set_page to initialize a bvec
Use the bvec_set_page helper to initialize a bvec.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-23-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vringh.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 33eb941fcf15..a1e27da54481 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -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; |