summaryrefslogtreecommitdiff
path: root/io_uring/uring_cmd.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-04-05 08:21:45 -0600
committerJens Axboe <axboe@kernel.dk>2023-04-05 09:30:18 -0600
commit758d5d64b619ddbbf96a5605d8d5a919aafaafab (patch)
treec2d544fd016fd2a47c9b0d70eab7b4b8b8b31fc1 /io_uring/uring_cmd.c
parent69bbc6ade9d9d4e3c556cb83e77b6f3cd9ad3d18 (diff)
io_uring/uring_cmd: assign ioucmd->cmd at async prep time
Rather than check this in the fast path issue, it makes more sense to just assign the copy of the data when we're setting it up anyway. This makes the code a bit cleaner, and removes the need for this check in the issue path. Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Reviewed-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/uring_cmd.c')
-rw-r--r--io_uring/uring_cmd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 3d825d939b13..f7a96bc76ea1 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -73,6 +73,7 @@ int io_uring_cmd_prep_async(struct io_kiocb *req)
cmd_size = uring_cmd_pdu_size(req->ctx->flags & IORING_SETUP_SQE128);
memcpy(req->async_data, ioucmd->cmd, cmd_size);
+ ioucmd->cmd = req->async_data;
return 0;
}
@@ -129,9 +130,6 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
WRITE_ONCE(ioucmd->cookie, NULL);
}
- if (req_has_async_data(req))
- ioucmd->cmd = req->async_data;
-
ret = file->f_op->uring_cmd(ioucmd, issue_flags);
if (ret == -EAGAIN) {
if (!req_has_async_data(req)) {