summaryrefslogtreecommitdiff
path: root/include/linux/io_uring.h
diff options
context:
space:
mode:
authorAnuj Gupta <anuj20.g@samsung.com>2022-09-30 09:27:38 +0300
committerJens Axboe <axboe@kernel.dk>2022-09-30 16:49:11 +0300
commita9216fac3ed8819cbbda5d39dd5fcaa43dfd35d8 (patch)
tree7fcfeafad737335ed0dedcd43375932aa7221a74 /include/linux/io_uring.h
parent851eb780decb7180bcf09fad0035cba9aae669df (diff)
downloadlinux-a9216fac3ed8819cbbda5d39dd5fcaa43dfd35d8.tar.xz
io_uring: add io_uring_cmd_import_fixed
This is a new helper that callers can use to obtain a bvec iterator for the previously mapped buffer. This is preparatory work to enable fixed-buffer support for io_uring_cmd. Signed-off-by: Anuj Gupta <anuj20.g@samsung.com> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Link: https://lore.kernel.org/r/20220930062749.152261-2-anuj20.g@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/io_uring.h')
-rw-r--r--include/linux/io_uring.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/io_uring.h b/include/linux/io_uring.h
index 58676c0a398f..1dbf51115c30 100644
--- a/include/linux/io_uring.h
+++ b/include/linux/io_uring.h
@@ -4,6 +4,7 @@
#include <linux/sched.h>
#include <linux/xarray.h>
+#include <uapi/linux/io_uring.h>
enum io_uring_cmd_flags {
IO_URING_F_COMPLETE_DEFER = 1,
@@ -32,6 +33,8 @@ struct io_uring_cmd {
};
#if defined(CONFIG_IO_URING)
+int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
+ struct iov_iter *iter, void *ioucmd);
void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, ssize_t res2);
void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
void (*task_work_cb)(struct io_uring_cmd *));
@@ -59,6 +62,11 @@ static inline void io_uring_free(struct task_struct *tsk)
__io_uring_free(tsk);
}
#else
+static int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
+ struct iov_iter *iter, void *ioucmd)
+{
+ return -EOPNOTSUPP;
+}
static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret,
ssize_t ret2)
{