io_uring/uring_cmd: copy SQE only when needed uring_cmd
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Jun 2025 21:26:12 +0000 (15:26 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 5 Jun 2025 16:29:21 +0000 (10:29 -0600)
commit5a690173c34c91b218fcc8b43fc8c84cfeb3797e
tree04b7d3071f652a4a2a2e7eae585ce793d1728ccf
parenta2c5f28cb2343aadc267b96a21a468790156ce9a
io_uring/uring_cmd: copy SQE only when needed

If the request is flagged with REQ_F_FORCE_ASYNC or REQ_F_ASYNC_PREP,
then there's a chance that it will get issued out-of-line. For that case,
the SQE must be copied.

Add an SQE copy helper, and use it on the prep side if the request is
flagged as such, and from the main issue path if we get -EAGAIN when
attempting to issue the request.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/uring_cmd.c