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: move io_req_put_rsrc_nodes()

It'd be nice to hide details of how rsrc nodes are used by a request
from rsrc.c, specifically which request fields store them, and what bits
are signifying if there is a node in a request. It rather belong to
generic request handling, so move the helper to io_uring.c. While doing
so remove clearing of ->buf_node as it's controlled by REQ_F_BUF_NODE
and doesn't require zeroing.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/bb73fb42baf825edb39344365aff48cdfdd4c692.1746533789.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
35adea1d 9c2ff3f9

+10 -12
+10
io_uring/io_uring.c
··· 1369 1369 io_req_task_queue(nxt); 1370 1370 } 1371 1371 1372 + static inline void io_req_put_rsrc_nodes(struct io_kiocb *req) 1373 + { 1374 + if (req->file_node) { 1375 + io_put_rsrc_node(req->ctx, req->file_node); 1376 + req->file_node = NULL; 1377 + } 1378 + if (req->flags & REQ_F_BUF_NODE) 1379 + io_put_rsrc_node(req->ctx, req->buf_node); 1380 + } 1381 + 1372 1382 static void io_free_batch_list(struct io_ring_ctx *ctx, 1373 1383 struct io_wq_work_node *node) 1374 1384 __must_hold(&ctx->uring_lock)
-12
io_uring/rsrc.h
··· 115 115 return true; 116 116 } 117 117 118 - static inline void io_req_put_rsrc_nodes(struct io_kiocb *req) 119 - { 120 - if (req->file_node) { 121 - io_put_rsrc_node(req->ctx, req->file_node); 122 - req->file_node = NULL; 123 - } 124 - if (req->flags & REQ_F_BUF_NODE) { 125 - io_put_rsrc_node(req->ctx, req->buf_node); 126 - req->buf_node = NULL; 127 - } 128 - } 129 - 130 118 int io_files_update(struct io_kiocb *req, unsigned int issue_flags); 131 119 int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); 132 120