diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2025-02-05 11:36:44 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-02-17 05:34:45 -0700 |
commit | dd4fbb11e7ccc15dbb197a5bbfb2ca8bfda89fcd (patch) | |
tree | 7d6ddaa84bd92d09d18728de3443448b62d4619b /io_uring/io_uring.c | |
parent | 9afe6847cff78e7f3aa8f4c920265cf298033251 (diff) |
io_uring/kbuf: move locking into io_kbuf_drop()
Move the burden of locking out of the caller into io_kbuf_drop(), that
will help with furher refactoring.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/530f0cf1f06963029399f819a9a58b1a34bebef3.1738724373.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r-- | io_uring/io_uring.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 6fa1e88e40fb..ed7c9081352a 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -398,11 +398,8 @@ static bool req_need_defer(struct io_kiocb *req, u32 seq) static void io_clean_op(struct io_kiocb *req) { - if (req->flags & REQ_F_BUFFER_SELECTED) { - spin_lock(&req->ctx->completion_lock); + if (unlikely(req->flags & REQ_F_BUFFER_SELECTED)) io_kbuf_drop(req); - spin_unlock(&req->ctx->completion_lock); - } if (req->flags & REQ_F_NEED_CLEANUP) { const struct io_cold_def *def = &io_cold_defs[req->opcode]; |