io_uring: move io_req_put_rsrc_nodes()
PATCH 1/1 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.
--- io_uring/io_uring.c | 10 ++++++++++ io_uring/rsrc.h | 12 ------------ 2 files changed, 10 insertions(+), 12 deletions(-)
io_uring/io_uring.c +10 -0
@@ -1369,6 +1369,16 @@ void io_queue_next(struct io_kiocb *req)io_req_task_queue (nxt); } +static inline void io_req_put_rsrc_nodes (struct io_kiocb *req) +{ +if (req->file_node) { +io_put_rsrc_node (req->ctx, req->file_node); + req->file_node =NULL ; + } +if (req->flags &REQ_F_BUF_NODE ) +io_put_rsrc_node (req->ctx, req->buf_node); +} + static void io_free_batch_list(struct io_ring_ctx *ctx, struct io_wq_work_node *node) __must_hold(&ctx->uring_lock)
io_uring/rsrc.h +0 -12
@@ -115,18 +115,6 @@ static inline bool io_reset_rsrc_node(struct io_ring_ctx *ctx,return true; } -static inline void io_req_put_rsrc_nodes (struct io_kiocb *req) -{ -if (req->file_node) { -io_put_rsrc_node (req->ctx, req->file_node); - req->file_node =NULL ; - } -if (req->flags &REQ_F_BUF_NODE ) { -io_put_rsrc_node (req->ctx, req->buf_node); - req->buf_node =NULL ; - } -} -int io_files_update (struct io_kiocb *req,unsigned int issue_flags);int io_files_update_prep (struct io_kiocb *req,const struct io_uring_sqe *sqe);
Signature · 1 line
2.48.1
Quoted 8 lines · Pavel Begunkov
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 toio_uring.c. While doing so remove clearing of ->buf_node as it's controlled byREQ_F_BUF_NODEand doesn't require zeroing.[...]
Applied, thanks!
[1/1] io_uring: move io_req_put_rsrc_nodes()
commit: 9c4dfa5b0c0256661a6a9d26729ce01e725918c4
Best regards,
Signature · 1 line
Jens Axboe