]> www.infradead.org Git - users/hch/block.git/commitdiff
vring: use bvec_set_page to initialize a bvec
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 16:45:33 +0000 (17:45 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 17:31:54 +0000 (18:31 +0100)
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/vhost/vringh.c

index 33eb941fcf154631eb32b01b42ef8ba80dc4ef34..a1e27da544814abf9d74e93ba97144ada7895f91 100644 (file)
@@ -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;