summaryrefslogtreecommitdiff
path: root/io_uring/filetable.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2024-11-07 19:01:34 +0800
committerJens Axboe <axboe@kernel.dk>2024-11-07 15:24:33 -0700
commit0d98c509086837a8cf5a32f82f2a58f39a539192 (patch)
treeea2fcd6c406d92ff8479964fc3b29c399e32f006 /io_uring/filetable.h
parentaf0a2ffef0e6d23412dd55df29f5caef8f3583f2 (diff)
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/filetable.h')
-rw-r--r--io_uring/filetable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/filetable.h b/io_uring/filetable.h
index bfacadb8d089..7717ea9efd0e 100644
--- a/io_uring/filetable.h
+++ b/io_uring/filetable.h
@@ -6,8 +6,8 @@
#include <linux/io_uring_types.h>
#include "rsrc.h"
-bool io_alloc_file_tables(struct io_file_table *table, unsigned nr_files);
-void io_free_file_tables(struct io_file_table *table);
+bool io_alloc_file_tables(struct io_ring_ctx *ctx, struct io_file_table *table, unsigned nr_files);
+void io_free_file_tables(struct io_ring_ctx *ctx, struct io_file_table *table);
int io_fixed_fd_install(struct io_kiocb *req, unsigned int issue_flags,
struct file *file, unsigned int file_slot);