The main idea here is to make make rsrc nodes (aka ref nodes) to be per ctx rather than per rsrc_data, that is a requirement for having multiple resource types. All the meat to it in 7/7. Also rsrc API is complicated and too misuse. 1-6 may be considered to be preps but also together with 7/7 gradually make the API simpler and so more resilient. v2: io_rsrc_node_destroy() last rsrc_node on ctx_free() Pavel Begunkov (7): io_uring: name rsrc bits consistently io_uring: simplify io_rsrc_node_ref_zero io_uring: use rsrc prealloc infra for files reg io_uring: encapsulate rsrc node manipulations io_uring: move rsrc_put callback into io_rsrc_data io_uring: refactor io_queue_rsrc_removal() io_uring: ctx-wide rsrc nodes fs/io_uring.c | 237 +++++++++++++++++++++----------------------------- 1 file changed, 97 insertions(+), 140 deletions(-) -- 2.24.0