Skip to content

Commit c732ea2

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent 953c37e commit c732ea2

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

io_uring/rsrc.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,12 @@ void io_rsrc_node_ref_zero(struct io_rsrc_node *node)
191191
{
192192
struct io_ring_ctx *ctx = node->rsrc_data->ctx;
193193

194-
node->done = true;
195194
while (!list_empty(&ctx->rsrc_ref_list)) {
196195
node = list_first_entry(&ctx->rsrc_ref_list,
197196
struct io_rsrc_node, node);
198197
/* recycle ref nodes in order */
199-
if (!node->done)
198+
if (node->refs)
200199
break;
201-
202200
list_del(&node->node);
203201
__io_rsrc_put_work(node);
204202
}
@@ -222,7 +220,6 @@ struct io_rsrc_node *io_rsrc_node_alloc(struct io_ring_ctx *ctx)
222220
ref_node->refs = 1;
223221
INIT_LIST_HEAD(&ref_node->node);
224222
INIT_LIST_HEAD(&ref_node->item_list);
225-
ref_node->done = false;
226223
ref_node->inline_items = 0;
227224
return ref_node;
228225
}

io_uring/rsrc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct io_rsrc_node {
4848
struct list_head node;
4949
struct llist_node llist;
5050
int refs;
51-
bool done;
5251

5352
/*
5453
* Keeps a list of struct io_rsrc_put to be completed. Each entry

0 commit comments

Comments
 (0)