Skip to content

Commit

Permalink
io_uring: hide caches sqes from drivers
Browse files Browse the repository at this point in the history
There is now an io_uring private part of cmd async_data, move saved sqe
into it. Drivers are accessing it via struct io_uring_cmd::cmd.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/ecbe078dd57acefdbc4366d083327086c0879378.1743357121.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Mar 31, 2025
1 parent 487a071 commit 296e169
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/linux/io_uring/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct io_uring_cmd {

struct io_uring_cmd_data {
void *op_data;
struct io_uring_sqe sqes[2];
};

static inline const void *io_uring_sqe_cmd(const struct io_uring_sqe *sqe)
Expand Down
4 changes: 2 additions & 2 deletions io_uring/uring_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req,
* that it doesn't read in per-op data, play it safe and ensure that
* any SQE data is stable beyond prep. This can later get relaxed.
*/
memcpy(ac->data.sqes, sqe, uring_sqe_size(req->ctx));
ioucmd->sqe = ac->data.sqes;
memcpy(ac->sqes, sqe, uring_sqe_size(req->ctx));
ioucmd->sqe = ac->sqes;
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions io_uring/uring_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
struct io_async_cmd {
struct io_uring_cmd_data data;
struct iou_vec vec;
struct io_uring_sqe sqes[2];
};

int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags);
Expand Down

0 comments on commit 296e169

Please sign in to comment.