io_uring/rsrc: unify file and buffer resource tables
authorJens Axboe <axboe@kernel.dk>
Sat, 26 Oct 2024 20:50:13 +0000 (14:50 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 28 Oct 2024 13:07:56 +0000 (07:07 -0600)
commit3d0548f19760fd80cfb5720d3d2aa3f428e27268
tree63055cc46093ac196d2d53203be6a9c57276ec09
parentb400c23f91cb155fb535913d0bbc927609c954ba
io_uring/rsrc: unify file and buffer resource tables

For files, there's nr_user_files/file_table/file_data, and buffers have
nr_user_bufs/user_bufs/buf_data. There's no reason why file_table and
file_data can't be the same thing, and ditto for the buffer side. That
gets rid of more io_ring_ctx state that's in two spots rather than just
being in one spot, as it should be. Put all the registered file data in
one locations, and ditto on the buffer front.

This also avoids having both io_rsrc_data->nodes being an allocated
array, and ->user_bufs[] or ->file_table.nodes. There's no reason to
have this information duplicated. Keep it in one spot, io_rsrc_data,
along with how many resources are available.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
17 files changed:
include/linux/io_uring_types.h
io_uring/cancel.c
io_uring/fdinfo.c
io_uring/filetable.c
io_uring/filetable.h
io_uring/io_uring.c
io_uring/msg_ring.c
io_uring/net.c
io_uring/nop.c
io_uring/opdef.c
io_uring/register.c
io_uring/rsrc.c
io_uring/rsrc.h
io_uring/rw.c
io_uring/splice.c
io_uring/splice.h
io_uring/uring_cmd.c