Commit cc342a21 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

io_uring: 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>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-19-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 664e4078
...@@ -1237,9 +1237,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov, ...@@ -1237,9 +1237,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
size_t vec_len; size_t vec_len;
vec_len = min_t(size_t, size, PAGE_SIZE - off); vec_len = min_t(size_t, size, PAGE_SIZE - off);
imu->bvec[i].bv_page = pages[i]; bvec_set_page(&imu->bvec[i], pages[i], vec_len, off);
imu->bvec[i].bv_len = vec_len;
imu->bvec[i].bv_offset = off;
off = 0; off = 0;
size -= vec_len; size -= vec_len;
} }
......
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