summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2024-03-18 22:00:24 +0000
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:24 -0600
commit6edd953b6ec758c98e9dba7234634831f1f6510d (patch)
treef654df8340518680a15e8b4194846f2a6a15f09c /io_uring
parentda12d9ab5889b87429d9375748dcd1485b6241f3 (diff)
downloadlinux-stable-6edd953b6ec758c98e9dba7234634831f1f6510d.tar.gz
linux-stable-6edd953b6ec758c98e9dba7234634831f1f6510d.tar.bz2
linux-stable-6edd953b6ec758c98e9dba7234634831f1f6510d.zip
io_uring/cmd: kill one issue_flags to tw conversion
io_uring cmd converts struct io_tw_state to issue_flags and later back to io_tw_state, it's awfully ill-fated, not to mention that intermediate issue_flags state is not correct. Get rid of the last conversion, drag through tw everything that came with IO_URING_F_UNLOCKED, and replace io_req_complete_defer() with a direct call to io_req_complete_defer(), at least for the time being. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Tested-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/c53fa3df749752bd058cf6f824a90704822d6bcc.1710799188.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/uring_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 1551848a9394..7c1c58c5837e 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -130,11 +130,11 @@ void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2,
if (req->ctx->flags & IORING_SETUP_IOPOLL) {
/* order with io_iopoll_req_issued() checking ->iopoll_complete */
smp_store_release(&req->iopoll_completed, 1);
+ } else if (!(issue_flags & IO_URING_F_UNLOCKED)) {
+ io_req_complete_defer(req);
} else {
- struct io_tw_state ts = {
- .locked = !(issue_flags & IO_URING_F_UNLOCKED),
- };
- io_req_task_complete(req, &ts);
+ req->io_task_work.func = io_req_task_complete;
+ io_req_task_work_add(req);
}
}
EXPORT_SYMBOL_GPL(io_uring_cmd_done);