Skip to content

Commit f41b075

Browse files
committed
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>
1 parent 3e97c25 commit f41b075

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

io_uring/io_uring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,12 +1073,14 @@ void io_queue_next(struct io_kiocb *req)
10731073

10741074
static inline void io_req_put_rsrc_nodes(struct io_kiocb *req)
10751075
{
1076+
struct io_ring_ctx *ctx = req->ctx;
1077+
10761078
if (req->file_node) {
1077-
io_put_rsrc_node(req->ctx, req->file_node);
1079+
io_put_rsrc_node(ctx, req->file_node);
10781080
req->file_node = NULL;
10791081
}
10801082
if (req->flags & REQ_F_BUF_NODE)
1081-
io_put_rsrc_node(req->ctx, req->buf_node);
1083+
io_put_rsrc_node(ctx, req->buf_node);
10821084
}
10831085

10841086
static void io_free_batch_list(struct io_ring_ctx *ctx,

0 commit comments

Comments
 (0)