summaryrefslogtreecommitdiff
path: root/io_uring/rsrc.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-04-13 15:28:06 +0100
committerJens Axboe <axboe@kernel.dk>2023-04-15 14:44:57 -0600
commitc732ea242d565c8281c4b017929fc62a246d81b9 (patch)
treeb67c199d8228126ecb24c49ba2af02c85fc6fa7c /io_uring/rsrc.c
parent953c37e066f05a3dca2d74643574b8dfe8a83983 (diff)
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: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/bbde361f4010f7e8bf196f1ecca27a763b79926f.1681395792.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r--io_uring/rsrc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 3c1538b8c8f4..5fc9d10743e0 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -191,14 +191,12 @@ void io_rsrc_node_ref_zero(struct io_rsrc_node *node)
{
struct io_ring_ctx *ctx = node->rsrc_data->ctx;
- node->done = true;
while (!list_empty(&ctx->rsrc_ref_list)) {
node = list_first_entry(&ctx->rsrc_ref_list,
struct io_rsrc_node, node);
/* recycle ref nodes in order */
- if (!node->done)
+ if (node->refs)
break;
-
list_del(&node->node);
__io_rsrc_put_work(node);
}
@@ -222,7 +220,6 @@ struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx)
ref_node->refs = 1;
INIT_LIST_HEAD(&ref_node->node);
INIT_LIST_HEAD(&ref_node->item_list);
- ref_node->done = false;
ref_node->inline_items = 0;
return ref_node;
}