io_uring/rsrc: refactor io_rsrc_node_switch
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 11 Apr 2023 11:06:07 +0000 (12:06 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Apr 2023 18:09:41 +0000 (12:09 -0600)
commit2933ae6eaa05e8db6ad33a3ca12af18d2a25358c
tree7ff931f2b1017b3a02df2e2004b5520c8a92ca95
parent13c223962eac16f161cf9b6355209774c609af28
io_uring/rsrc: refactor io_rsrc_node_switch

We use io_rsrc_node_switch() coupled with io_rsrc_node_switch_start()
for a bunch of cases including initialising ctx->rsrc_node, i.e. by
passing NULL instead of rsrc_data. Leave it to only deal with actual
node changing.

For that, first remove it from io_uring_create() and add a function
allocating the first node. Then also remove all calls to
io_rsrc_node_switch() from files/buffers register as we already have a
node installed and it does essentially nothing.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d146fe306ff98b1a5a60c997c252534f03d423d7.1681210788.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/rsrc.c
io_uring/rsrc.h