Commit c824986c authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring/rsrc: rename rsrc_list

We have too many "rsrc" around which makes the name of struct
io_rsrc_node::rsrc_list confusing. The field is responsible for keeping
a list of files or buffers, so call it item_list and add comments
around.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/3e34d4dfc1fdbb6b520f904ee6187c2ccf680efe.1680576071.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0a4813b1
...@@ -146,7 +146,7 @@ static void __io_rsrc_put_work(struct io_rsrc_node *ref_node) ...@@ -146,7 +146,7 @@ static void __io_rsrc_put_work(struct io_rsrc_node *ref_node)
struct io_ring_ctx *ctx = rsrc_data->ctx; struct io_ring_ctx *ctx = rsrc_data->ctx;
struct io_rsrc_put *prsrc, *tmp; struct io_rsrc_put *prsrc, *tmp;
list_for_each_entry_safe(prsrc, tmp, &ref_node->rsrc_list, list) { list_for_each_entry_safe(prsrc, tmp, &ref_node->item_list, list) {
list_del(&prsrc->list); list_del(&prsrc->list);
if (prsrc->tag) { if (prsrc->tag) {
...@@ -249,7 +249,7 @@ static struct io_rsrc_node *io_rsrc_node_alloc(void) ...@@ -249,7 +249,7 @@ static struct io_rsrc_node *io_rsrc_node_alloc(void)
ref_node->refs = 1; ref_node->refs = 1;
INIT_LIST_HEAD(&ref_node->node); INIT_LIST_HEAD(&ref_node->node);
INIT_LIST_HEAD(&ref_node->rsrc_list); INIT_LIST_HEAD(&ref_node->item_list);
ref_node->done = false; ref_node->done = false;
return ref_node; return ref_node;
} }
...@@ -737,7 +737,7 @@ int io_queue_rsrc_removal(struct io_rsrc_data *data, unsigned idx, ...@@ -737,7 +737,7 @@ int io_queue_rsrc_removal(struct io_rsrc_data *data, unsigned idx,
prsrc->tag = *tag_slot; prsrc->tag = *tag_slot;
*tag_slot = 0; *tag_slot = 0;
prsrc->rsrc = rsrc; prsrc->rsrc = rsrc;
list_add(&prsrc->list, &node->rsrc_list); list_add(&prsrc->list, &node->item_list);
return 0; return 0;
} }
......
...@@ -38,11 +38,17 @@ struct io_rsrc_data { ...@@ -38,11 +38,17 @@ struct io_rsrc_data {
struct io_rsrc_node { struct io_rsrc_node {
struct list_head node; struct list_head node;
struct list_head rsrc_list;
struct io_rsrc_data *rsrc_data; struct io_rsrc_data *rsrc_data;
struct llist_node llist; struct llist_node llist;
int refs; int refs;
bool done; bool done;
/*
* Keeps a list of struct io_rsrc_put to be completed. Each entry
* represents one rsrc (e.g. file or buffer), but all of them should've
* came from the same table and so are of the same type.
*/
struct list_head item_list;
}; };
struct io_mapped_ubuf { struct io_mapped_ubuf {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment