diff options
author | Ming Lei <ming.lei@redhat.com> | 2024-11-07 19:01:36 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-07 15:24:33 -0700 |
commit | 039c878db7add23c1c9ea18424c442cce76670f9 (patch) | |
tree | 5815f2cce4e7e3667058e68a6f624a39731a4eb3 /io_uring/nop.c | |
parent | 4f219fcce5e4366cc121fc98270beb1fbbb3df2b (diff) |
io_uring/rsrc: add & apply io_req_assign_buf_node()
The following pattern becomes more and more:
+ io_req_assign_rsrc_node(&req->buf_node, node);
+ req->flags |= REQ_F_BUF_NODE;
so make it a helper, which is less fragile to use than above code, for
example, the BUF_NODE flag is even missed in current io_uring_cmd_prep().
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241107110149.890530-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/nop.c')
-rw-r--r-- | io_uring/nop.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/io_uring/nop.c b/io_uring/nop.c index bc22bcc739f3..6d470d4251ee 100644 --- a/io_uring/nop.c +++ b/io_uring/nop.c @@ -67,8 +67,7 @@ int io_nop(struct io_kiocb *req, unsigned int issue_flags) io_ring_submit_lock(ctx, issue_flags); node = io_rsrc_node_lookup(&ctx->buf_table, nop->buffer); if (node) { - io_req_assign_rsrc_node(&req->buf_node, node); - req->flags |= REQ_F_BUF_NODE; + io_req_assign_buf_node(req, node); ret = 0; } io_ring_submit_unlock(ctx, issue_flags); |