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

io_uring/rsrc: remove io_rsrc_node::done

Kill io_rsrc_node::node and check refs instead, it's set when the nodes
refcount hits zero, and it won't change afterwards.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/bbde361f4010f7e8bf196f1ecca27a763b79926f.1681395792.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 953c37e0
...@@ -191,14 +191,12 @@ void io_rsrc_node_ref_zero(struct io_rsrc_node *node) ...@@ -191,14 +191,12 @@ void io_rsrc_node_ref_zero(struct io_rsrc_node *node)
{ {
struct io_ring_ctx *ctx = node->rsrc_data->ctx; struct io_ring_ctx *ctx = node->rsrc_data->ctx;
node->done = true;
while (!list_empty(&ctx->rsrc_ref_list)) { while (!list_empty(&ctx->rsrc_ref_list)) {
node = list_first_entry(&ctx->rsrc_ref_list, node = list_first_entry(&ctx->rsrc_ref_list,
struct io_rsrc_node, node); struct io_rsrc_node, node);
/* recycle ref nodes in order */ /* recycle ref nodes in order */
if (!node->done) if (node->refs)
break; break;
list_del(&node->node); list_del(&node->node);
__io_rsrc_put_work(node); __io_rsrc_put_work(node);
} }
...@@ -222,7 +220,6 @@ struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx) ...@@ -222,7 +220,6 @@ struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx)
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->item_list); INIT_LIST_HEAD(&ref_node->item_list);
ref_node->done = false;
ref_node->inline_items = 0; ref_node->inline_items = 0;
return ref_node; return ref_node;
} }
......
...@@ -48,7 +48,6 @@ struct io_rsrc_node { ...@@ -48,7 +48,6 @@ struct io_rsrc_node {
struct list_head node; struct list_head node;
struct llist_node llist; struct llist_node llist;
int refs; int refs;
bool done;
/* /*
* Keeps a list of struct io_rsrc_put to be completed. Each entry * Keeps a list of struct io_rsrc_put to be completed. Each entry
......
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