Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
60e6ce74 0e893472

+2 -3
+2 -3
io_uring/io_uring.c
··· 1997 1997 return true; 1998 1998 } 1999 1999 2000 - static void io_init_req_drain(struct io_kiocb *req) 2000 + static void io_init_drain(struct io_ring_ctx *ctx) 2001 2001 { 2002 - struct io_ring_ctx *ctx = req->ctx; 2003 2002 struct io_kiocb *head = ctx->submit_state.link.head; 2004 2003 2005 2004 ctx->drain_active = true; ··· 2060 2061 if (sqe_flags & IOSQE_IO_DRAIN) { 2061 2062 if (ctx->drain_disabled) 2062 2063 return io_init_fail_req(req, -EOPNOTSUPP); 2063 - io_init_req_drain(req); 2064 + io_init_drain(ctx); 2064 2065 } 2065 2066 } 2066 2067 if (unlikely(ctx->restricted || ctx->drain_active || ctx->drain_next)) {