diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2024-03-18 23:00:30 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-04-15 16:10:24 +0200 |
commit | 8e5b3b89ecaf6d9295e561c225b35c574a5e0fe7 (patch) | |
tree | 6a35205e09dd5a3ec397a3c1c38445b032856000 /io_uring/io_uring.h | |
parent | io_uring: force tw ctx locking (diff) | |
download | linux-8e5b3b89ecaf6d9295e561c225b35c574a5e0fe7.tar.xz linux-8e5b3b89ecaf6d9295e561c225b35c574a5e0fe7.zip |
io_uring: remove struct io_tw_state::locked
ctx is always locked for task_work now, so get rid of struct
io_tw_state::locked. Note I'm stopping one step before removing
io_tw_state altogether, which is not empty, because it still serves the
purpose of indicating which function is a tw callback and forcing users
not to invoke them carelessly out of a wrong context. The removal can
always be done later.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/e95e1ea116d0bfa54b656076e6a977bc221392a4.1710799188.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.h')
-rw-r--r-- | io_uring/io_uring.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 0861d49e83de..7f921daae9c3 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -351,10 +351,7 @@ static inline bool io_task_work_pending(struct io_ring_ctx *ctx) static inline void io_tw_lock(struct io_ring_ctx *ctx, struct io_tw_state *ts) { - if (!ts->locked) { - mutex_lock(&ctx->uring_lock); - ts->locked = true; - } + lockdep_assert_held(&ctx->uring_lock); } /* |