summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-24 20:56:42 +0300
committerJens Axboe <axboe@kernel.dk>2022-07-25 03:39:11 +0300
commite28683bdfc2f2cb0dab042f9079cda89dbf589d9 (patch)
tree60ec99fa61b6de11bf9749a4ce56007666f354e9
parent5e2a18d93fec514fc74f58a6061b74a79764af69 (diff)
downloadlinux-e28683bdfc2f2cb0dab042f9079cda89dbf589d9.tar.xz
io_uring: move nop into its own file
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/Makefile2
-rw-r--r--io_uring/io_uring.c15
-rw-r--r--io_uring/nop.c26
-rw-r--r--io_uring/nop.h4
4 files changed, 32 insertions, 15 deletions
diff --git a/io_uring/Makefile b/io_uring/Makefile
index 479b6957b85f..32c02a38f83b 100644
--- a/io_uring/Makefile
+++ b/io_uring/Makefile
@@ -2,5 +2,5 @@
#
# Makefile for io_uring
-obj-$(CONFIG_IO_URING) += io_uring.o xattr.o
+obj-$(CONFIG_IO_URING) += io_uring.o xattr.o nop.o
obj-$(CONFIG_IO_WQ) += io-wq.o
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1af97e4a78b7..3e74925bd4b4 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -93,6 +93,7 @@
#include "io_uring.h"
#include "xattr.h"
+#include "nop.h"
#define IORING_MAX_ENTRIES 32768
#define IORING_MAX_CQ_ENTRIES (2 * IORING_MAX_ENTRIES)
@@ -4298,20 +4299,6 @@ done:
return IOU_OK;
}
-static int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
-{
- return 0;
-}
-
-/*
- * IORING_OP_NOP just posts a completion event, nothing else.
- */
-static int io_nop(struct io_kiocb *req, unsigned int issue_flags)
-{
- io_req_set_res(req, 0, 0);
- return IOU_OK;
-}
-
static int io_msg_ring_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
diff --git a/io_uring/nop.c b/io_uring/nop.c
new file mode 100644
index 000000000000..d363d8ce70a3
--- /dev/null
+++ b/io_uring/nop.c
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/file.h>
+#include <linux/io_uring.h>
+
+#include <uapi/linux/io_uring.h>
+
+#include "io_uring_types.h"
+#include "io_uring.h"
+#include "nop.h"
+
+int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
+{
+ return 0;
+}
+
+/*
+ * IORING_OP_NOP just posts a completion event, nothing else.
+ */
+int io_nop(struct io_kiocb *req, unsigned int issue_flags)
+{
+ io_req_set_res(req, 0, 0);
+ return IOU_OK;
+}
diff --git a/io_uring/nop.h b/io_uring/nop.h
new file mode 100644
index 000000000000..97f1535c9dec
--- /dev/null
+++ b/io_uring/nop.h
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
+
+int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
+int io_nop(struct io_kiocb *req, unsigned int issue_flags);