io_uring: move nop into its own file
authorJens Axboe <axboe@kernel.dk>
Tue, 24 May 2022 17:56:42 +0000 (11:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:39:11 +0000 (18:39 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/Makefile
io_uring/io_uring.c
io_uring/nop.c [new file with mode: 0644]
io_uring/nop.h [new file with mode: 0644]

index 479b695..32c02a3 100644 (file)
@@ -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
index 1af97e4..3e74925 100644 (file)
@@ -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 (file)
index 0000000..d363d8c
--- /dev/null
@@ -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 (file)
index 0000000..97f1535
--- /dev/null
@@ -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);