Skip to content

Commit

Permalink
io_uring/rsrc: kill io_charge_rsrc_node()
Browse files Browse the repository at this point in the history
It's only used from __io_req_set_rsrc_node(), and it takes both the ctx
and node itself, while never using the ctx. Just open-code the basic
refs++ in __io_req_set_rsrc_node() instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Oct 29, 2024
1 parent 743fb58 commit e410ffc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions io_uring/rsrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,12 @@ static inline void io_put_rsrc_node(struct io_ring_ctx *ctx, struct io_rsrc_node
io_rsrc_node_ref_zero(node);
}

static inline void io_charge_rsrc_node(struct io_ring_ctx *ctx,
struct io_rsrc_node *node)
{
node->refs++;
}

static inline void __io_req_set_rsrc_node(struct io_kiocb *req,
struct io_ring_ctx *ctx)
{
lockdep_assert_held(&ctx->uring_lock);
req->rsrc_node = ctx->rsrc_node;
io_charge_rsrc_node(ctx, ctx->rsrc_node);
ctx->rsrc_node->refs++;
}

static inline void io_req_set_rsrc_node(struct io_kiocb *req,
Expand Down

0 comments on commit e410ffc

Please sign in to comment.