Skip to content

Commit 60e6ce7

Browse files
calebsanderaxboe
authored andcommitted
io_uring: pass ctx instead of req to io_init_req_drain()
io_init_req_drain() takes a struct io_kiocb *req argument but only uses it to get struct io_ring_ctx *ctx. The caller already knows the ctx, so pass it instead. Drop "req" from the function name since it operates on the ctx rather than a specific req. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Link: https://lore.kernel.org/r/20250212164807.3681036-1-csander@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0e89347 commit 60e6ce7

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

io_uring/io_uring.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,9 +1997,8 @@ static inline bool io_check_restriction(struct io_ring_ctx *ctx,
19971997
return true;
19981998
}
19991999

2000-
static void io_init_req_drain(struct io_kiocb *req)
2000+
static void io_init_drain(struct io_ring_ctx *ctx)
20012001
{
2002-
struct io_ring_ctx *ctx = req->ctx;
20032002
struct io_kiocb *head = ctx->submit_state.link.head;
20042003

20052004
ctx->drain_active = true;
@@ -2061,7 +2060,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
20612060
if (sqe_flags & IOSQE_IO_DRAIN) {
20622061
if (ctx->drain_disabled)
20632062
return io_init_fail_req(req, -EOPNOTSUPP);
2064-
io_init_req_drain(req);
2063+
io_init_drain(ctx);
20652064
}
20662065
}
20672066
if (unlikely(ctx->restricted || ctx->drain_active || ctx->drain_next)) {

0 commit comments

Comments
 (0)