8e5b3b89ecaf ("io_uring: remove struct io_tw_state::locked") removed the
only field of io_tw_state but kept it as a task work callback argument
to "forc[e] users not to invoke them carelessly out of a wrong context".
Passing the struct io_tw_state * argument adds a few instructions to all
callers that can't inline the functions and see the argument is unused.
So pass struct io_tw_state by value instead. Since it's a 0-sized value,
it can be passed without any instructions needed to initialize it.
Also add a comment to struct io_tw_state to explain its purpose.
Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
---
include/linux/io_uring_types.h | 3 ++-
io_uring/futex.c | 6 +++---
io_uring/io_uring.c | 30 +++++++++++++++---------------
io_uring/io_uring.h | 8 ++++----
io_uring/msg_ring.c | 2 +-
io_uring/notif.c | 2 +-
io_uring/poll.c | 4 ++--
io_uring/poll.h | 2 +-
io_uring/rw.c | 2 +-
io_uring/rw.h | 2 +-
io_uring/timeout.c | 6 +++---
io_uring/uring_cmd.c | 2 +-
io_uring/waitid.c | 6 +++---
13 files changed, 38 insertions(+), 37 deletions(-)
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
index e2fef264ff8b..4abd0299fdfb 100644
--- a/include/linux/io_uring_types.h
+++ b/include/linux/io_uring_types.h
@@ -434,10 +434,11 @@ struct io_ring_ctx {
struct io_mapped_region ring_region;
/* used for optimised request parameter and wait argument passing */
struct io_mapped_region param_region;
};
+/* Token passed to task work callbacks to indicate ctx->uring_lock is held */
struct io_tw_state {
};