1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include <linux/errno.h>
5 #include <linux/file.h>
6 #include <linux/io_uring.h>
8 #include <uapi/linux/io_uring.h>
14 /* NOTE: kiocb has the file as the first member, so don't do it here */
19 int io_nop_prep(struct io_kiocb
*req
, const struct io_uring_sqe
*sqe
)
22 struct io_nop
*nop
= io_kiocb_to_cmd(req
, struct io_nop
);
24 flags
= READ_ONCE(sqe
->nop_flags
);
25 if (flags
& ~IORING_NOP_INJECT_RESULT
)
28 if (flags
& IORING_NOP_INJECT_RESULT
)
29 nop
->result
= READ_ONCE(sqe
->len
);
35 int io_nop(struct io_kiocb
*req
, unsigned int issue_flags
)
37 struct io_nop
*nop
= io_kiocb_to_cmd(req
, struct io_nop
);
41 io_req_set_res(req
, nop
->result
, 0);