diff options
| author | Ming Lei <ming.lei@redhat.com> | 2024-11-07 19:01:34 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2024-11-07 15:24:33 -0700 |
| commit | 0d98c509086837a8cf5a32f82f2a58f39a539192 (patch) | |
| tree | ea2fcd6c406d92ff8479964fc3b29c399e32f006 /io_uring/splice.c | |
| parent | af0a2ffef0e6d23412dd55df29f5caef8f3583f2 (diff) | |
| download | linux-0d98c509086837a8cf5a32f82f2a58f39a539192.tar.gz linux-0d98c509086837a8cf5a32f82f2a58f39a539192.tar.bz2 linux-0d98c509086837a8cf5a32f82f2a58f39a539192.zip | |
io_uring/rsrc: pass 'struct io_ring_ctx' reference to rsrc helpers
`io_rsrc_node` instance won't be shared among different io_uring ctxs,
and its allocation 'ctx' is always same with the user's 'ctx', so it is
safe to pass user 'ctx' reference to rsrc helpers. Even in io_clone_buffers(),
`io_rsrc_node` instance is allocated actually for destination io_uring_ctx.
Then io_rsrc_node_ctx() can be removed, and the 8 bytes `ctx` pointer will be
removed from `io_rsrc_node` in the following patch.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241107110149.890530-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/splice.c')
| -rw-r--r-- | io_uring/splice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/splice.c b/io_uring/splice.c index e8ed15f4ea1a..5b84f1630611 100644 --- a/io_uring/splice.c +++ b/io_uring/splice.c @@ -51,7 +51,7 @@ void io_splice_cleanup(struct io_kiocb *req) { struct io_splice *sp = io_kiocb_to_cmd(req, struct io_splice); - io_put_rsrc_node(sp->rsrc_node); + io_put_rsrc_node(req->ctx, sp->rsrc_node); } static struct file *io_splice_get_file(struct io_kiocb *req, |
