summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2026-03-17 23:28:44 +0300
committerJens Axboe <axboe@kernel.dk>2026-03-17 23:35:00 +0300
commitf41b075492355c60d87ddd66371dcdb1ae9c484e (patch)
treea02d9e9c977902f0eb28bd2524860384b78a6259
parent3e97c2582f8450117dfa14cc672437afb31233a0 (diff)
downloadlinux-f41b075492355c60d87ddd66371dcdb1ae9c484e.tar.xz
io_uring: avoid req->ctx reload in io_req_put_rsrc_nodes()
Cache 'ctx' to avoid it needing to get potentially reloaded. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/io_uring.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index d703f0a8b315..6eaa21e09469 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1073,12 +1073,14 @@ void io_queue_next(struct io_kiocb *req)
static inline void io_req_put_rsrc_nodes(struct io_kiocb *req)
{
+ struct io_ring_ctx *ctx = req->ctx;
+
if (req->file_node) {
- io_put_rsrc_node(req->ctx, req->file_node);
+ io_put_rsrc_node(ctx, req->file_node);
req->file_node = NULL;
}
if (req->flags & REQ_F_BUF_NODE)
- io_put_rsrc_node(req->ctx, req->buf_node);
+ io_put_rsrc_node(ctx, req->buf_node);
}
static void io_free_batch_list(struct io_ring_ctx *ctx,