From: Christoph Hellwig Date: Fri, 3 Feb 2023 15:06:20 +0000 (+0100) Subject: virtio_blk: use bvec_set_virt to initialize special_vec X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b831f3a1031664ae2443bab63d35c416ed30c91d;p=linux.git virtio_blk: use bvec_set_virt to initialize special_vec Use the bvec_set_virt helper to initialize the special_vec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Link: https://lore.kernel.org/r/20230203150634.3199647-10-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6a77fa9174288..dc6e9b989910b 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -170,9 +170,7 @@ static int virtblk_setup_discard_write_zeroes_erase(struct request *req, bool un WARN_ON_ONCE(n != segments); - req->special_vec.bv_page = virt_to_page(range); - req->special_vec.bv_offset = offset_in_page(range); - req->special_vec.bv_len = sizeof(*range) * segments; + bvec_set_virt(&req->special_vec, range, sizeof(*range) * segments); req->rq_flags |= RQF_SPECIAL_PAYLOAD; return 0;