From: Jens Axboe <axboe@kernel.dk>
To: io-uring <io-uring@vger.kernel.org>
Subject: [PATCH] io_uring: remove 'issue_flags' argument for io_req_set_rsrc_node()
Date: Wed, 23 Oct 2024 07:59:27 -0600 [thread overview]
Message-ID: <9670c026-848c-433f-a473-452194aa8cb2@kernel.dk> (raw)
All callers already hold the ring lock and hence are passing '0',
remove the argument and the conditional locking that it controlled.
Suggested-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
Took a second look at this, and it does indeed fall out nicely
if done prior to the (buggy) net conversion. Fixed that one up too,
fwiw.
diff --git a/io_uring/net.c b/io_uring/net.c
index 18507658a921..fb1f2c37f7d1 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1261,7 +1261,7 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
return -EFAULT;
idx = array_index_nospec(idx, ctx->nr_user_bufs);
req->imu = READ_ONCE(ctx->user_bufs[idx]);
- io_req_set_rsrc_node(notif, ctx, 0);
+ io_req_set_rsrc_node(notif, ctx);
}
if (req->opcode == IORING_OP_SEND_ZC) {
diff --git a/io_uring/rsrc.h b/io_uring/rsrc.h
index 8ed588036210..c50d4be4aa6d 100644
--- a/io_uring/rsrc.h
+++ b/io_uring/rsrc.h
@@ -107,14 +107,10 @@ static inline void __io_req_set_rsrc_node(struct io_kiocb *req,
}
static inline void io_req_set_rsrc_node(struct io_kiocb *req,
- struct io_ring_ctx *ctx,
- unsigned int issue_flags)
+ struct io_ring_ctx *ctx)
{
- if (!req->rsrc_node) {
- io_ring_submit_lock(ctx, issue_flags);
+ if (!req->rsrc_node)
__io_req_set_rsrc_node(req, ctx);
- io_ring_submit_unlock(ctx, issue_flags);
- }
}
static inline u64 *io_get_tag_slot(struct io_rsrc_data *data, unsigned int idx)
diff --git a/io_uring/rw.c b/io_uring/rw.c
index c633365aa37d..4bc0d762627d 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -343,7 +343,7 @@ static int io_prep_rw_fixed(struct io_kiocb *req, const struct io_uring_sqe *sqe
return -EFAULT;
index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
imu = ctx->user_bufs[index];
- io_req_set_rsrc_node(req, ctx, 0);
+ io_req_set_rsrc_node(req, ctx);
io = req->async_data;
ret = io_import_fixed(ddir, &io->iter, imu, rw->addr, rw->len);
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 58d0b817d6ea..6994f60d7ec7 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -220,7 +220,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
* being called. This prevents destruction of the mapped buffer
* we'll need at actual import time.
*/
- io_req_set_rsrc_node(req, ctx, 0);
+ io_req_set_rsrc_node(req, ctx);
}
ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);
--
Jens Axboe
reply other threads:[~2024-10-23 13:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9670c026-848c-433f-a473-452194aa8cb2@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.