summaryrefslogtreecommitdiff
path: root/io_uring/rsrc.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-04-18 16:06:38 +0300
committerJens Axboe <axboe@kernel.dk>2023-04-19 04:38:26 +0300
commit4130b49991d6b8ca0ea44cb256e710c4e48d7f01 (patch)
treed39f8ce595e372a661ae6a109b898c2c8539f8d2 /io_uring/rsrc.c
parent26147da37f3e52041d9deba189d39f27ce78a84f (diff)
downloadlinux-4130b49991d6b8ca0ea44cb256e710c4e48d7f01.tar.xz
io_uring/rsrc: inline io_rsrc_put_work()
io_rsrc_put_work() is simple enough to be open coded into its only caller. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/1b36dd46766ced39a9b160767babfa2fce07b8f8.1681822823.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.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 127bd602131e..d1167b0643b7 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -140,8 +140,8 @@ static void io_buffer_unmap(struct io_ring_ctx *ctx, struct io_mapped_ubuf **slo
*slot = NULL;
}
-static void io_rsrc_put_work_one(struct io_rsrc_data *rsrc_data,
- struct io_rsrc_put *prsrc)
+static void io_rsrc_put_work(struct io_rsrc_data *rsrc_data,
+ struct io_rsrc_put *prsrc)
{
struct io_ring_ctx *ctx = rsrc_data->ctx;
@@ -150,16 +150,6 @@ static void io_rsrc_put_work_one(struct io_rsrc_data *rsrc_data,
rsrc_data->do_put(ctx, prsrc);
}
-static void __io_rsrc_put_work(struct io_rsrc_node *ref_node)
-{
- struct io_rsrc_data *rsrc_data = ref_node->rsrc_data;
-
- if (likely(!ref_node->empty))
- io_rsrc_put_work_one(rsrc_data, &ref_node->item);
-
- io_rsrc_node_destroy(rsrc_data->ctx, ref_node);
-}
-
void io_rsrc_node_destroy(struct io_ring_ctx *ctx, struct io_rsrc_node *node)
{
if (!io_alloc_cache_put(&ctx->rsrc_node_cache, &node->cache))
@@ -178,7 +168,10 @@ void io_rsrc_node_ref_zero(struct io_rsrc_node *node)
if (node->refs)
break;
list_del(&node->node);
- __io_rsrc_put_work(node);
+
+ if (likely(!node->empty))
+ io_rsrc_put_work(node->rsrc_data, &node->item);
+ io_rsrc_node_destroy(ctx, node);
}
if (list_empty(&ctx->rsrc_ref_list) && unlikely(ctx->rsrc_quiesce))
wake_up_all(&ctx->rsrc_quiesce_wq);