Commit ff126177 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: inline __io_cq_unlock

__io_cq_unlock is not very helpful, and users should be calling flush
variants anyway. Open code the function.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d875c4cfb69f38ccecb58a57111446c77a614caa.1687518903.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 55b6a69f
...@@ -631,12 +631,6 @@ static inline void __io_cq_lock(struct io_ring_ctx *ctx) ...@@ -631,12 +631,6 @@ static inline void __io_cq_lock(struct io_ring_ctx *ctx)
spin_lock(&ctx->completion_lock); spin_lock(&ctx->completion_lock);
} }
static inline void __io_cq_unlock(struct io_ring_ctx *ctx)
{
if (!ctx->task_complete)
spin_unlock(&ctx->completion_lock);
}
static inline void io_cq_lock(struct io_ring_ctx *ctx) static inline void io_cq_lock(struct io_ring_ctx *ctx)
__acquires(ctx->completion_lock) __acquires(ctx->completion_lock)
{ {
...@@ -647,7 +641,9 @@ static inline void io_cq_lock(struct io_ring_ctx *ctx) ...@@ -647,7 +641,9 @@ static inline void io_cq_lock(struct io_ring_ctx *ctx)
static inline void __io_cq_unlock_post(struct io_ring_ctx *ctx) static inline void __io_cq_unlock_post(struct io_ring_ctx *ctx)
{ {
io_commit_cqring(ctx); io_commit_cqring(ctx);
__io_cq_unlock(ctx); if (!ctx->task_complete)
spin_unlock(&ctx->completion_lock);
io_commit_cqring_flush(ctx); io_commit_cqring_flush(ctx);
io_cqring_wake(ctx); io_cqring_wake(ctx);
} }
...@@ -664,7 +660,7 @@ static void __io_cq_unlock_post_flush(struct io_ring_ctx *ctx) ...@@ -664,7 +660,7 @@ static void __io_cq_unlock_post_flush(struct io_ring_ctx *ctx)
*/ */
io_commit_cqring_flush(ctx); io_commit_cqring_flush(ctx);
} else { } else {
__io_cq_unlock(ctx); spin_unlock(&ctx->completion_lock);
io_commit_cqring_flush(ctx); io_commit_cqring_flush(ctx);
io_cqring_wake(ctx); io_cqring_wake(ctx);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment