diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2025-03-07 16:00:29 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-03-07 09:07:29 -0700 |
commit | e1d499590977a492ae120d9263bd55076aabd460 (patch) | |
tree | 11d97d8462945c701fc09aeb98ced7a340cbb41b /io_uring/rsrc.c | |
parent | 6e3da40ed6f3508dcf34b1539496bcccef7015ef (diff) |
io_uring: introduce struct iou_vec
I need a convenient way to pass around and work with iovec+size pair,
put them into a structure and makes use of it in rw.c
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d39fadafc9e9047b0a292e5be6db3cf2f48bb1f7.1741362889.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r-- | io_uring/rsrc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 28783f1dde00..bac509f85c80 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1260,3 +1260,12 @@ int io_register_clone_buffers(struct io_ring_ctx *ctx, void __user *arg) fput(file); return ret; } + +void io_vec_free(struct iou_vec *iv) +{ + if (!iv->iovec) + return; + kfree(iv->iovec); + iv->iovec = NULL; + iv->nr = 0; +} |