Skip to content

Commit

Permalink
io_uring: use bvec_set_page to initialize a bvec
Browse files Browse the repository at this point in the history
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Feb 3, 2023
1 parent 664e407 commit cc342a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions io_uring/rsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov,
size_t vec_len;

vec_len = min_t(size_t, size, PAGE_SIZE - off);
imu->bvec[i].bv_page = pages[i];
imu->bvec[i].bv_len = vec_len;
imu->bvec[i].bv_offset = off;
bvec_set_page(&imu->bvec[i], pages[i], vec_len, off);
off = 0;
size -= vec_len;
}
Expand Down

0 comments on commit cc342a2

Please sign in to comment.