xref: /openbmc/linux/io_uring/nop.c (revision d6344cc8)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include <linux/errno.h>
4 #include <linux/fs.h>
5 #include <linux/file.h>
6 #include <linux/io_uring.h>
7 
8 #include <uapi/linux/io_uring.h>
9 
10 #include "io_uring.h"
11 #include "nop.h"
12 
13 int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
14 {
15 	if (READ_ONCE(sqe->rw_flags))
16 		return -EINVAL;
17 	return 0;
18 }
19 
20 /*
21  * IORING_OP_NOP just posts a completion event, nothing else.
22  */
23 int io_nop(struct io_kiocb *req, unsigned int issue_flags)
24 {
25 	io_req_set_res(req, 0, 0);
26 	return IOU_OK;
27 }
28