summaryrefslogtreecommitdiff
path: root/include/linux/io_uring/cmd.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-20 02:10:50 +0300
committerJens Axboe <axboe@kernel.dk>2024-04-15 17:10:24 +0300
commit1afdb76038e27a3a4dd4cf522f6457868051db84 (patch)
tree2c373114914cce65bc3753fc9ec8ea9fdbf37b28 /include/linux/io_uring/cmd.h
parent36a005b9c66eade68f4235e612d733510a8d52ff (diff)
downloadlinux-1afdb76038e27a3a4dd4cf522f6457868051db84.tar.xz
nvme/io_uring: use helper for polled completions
NVMe is making up issue_flags, which is a no-no in general, and to make matters worse, they are completely the wrong ones. For a pure polled request, which it does check for, we're already inside the ctx->uring_lock when the completions are run off io_do_iopoll(). Hence the correct flag would be '0' rather than IO_URING_F_UNLOCKED. Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/io_uring/cmd.h')
-rw-r--r--include/linux/io_uring/cmd.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h
index 01b95505538a..447fbfd32215 100644
--- a/include/linux/io_uring/cmd.h
+++ b/include/linux/io_uring/cmd.h
@@ -69,6 +69,17 @@ static inline void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
}
#endif
+/*
+ * Polled completions must ensure they are coming from a poll queue, and
+ * hence are completed inside the usual poll handling loops.
+ */
+static inline void io_uring_cmd_iopoll_done(struct io_uring_cmd *ioucmd,
+ ssize_t ret, ssize_t res2)
+{
+ lockdep_assert(in_task());
+ io_uring_cmd_done(ioucmd, ret, res2, 0);
+}
+
/* users must follow the IOU_F_TWQ_LAZY_WAKE semantics */
static inline void io_uring_cmd_do_in_task_lazy(struct io_uring_cmd *ioucmd,
void (*task_work_cb)(struct io_uring_cmd *, unsigned))