1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef _LINUX_IO_URING_H
3 #define _LINUX_IO_URING_H
5 #include <linux/sched.h>
6 #include <linux/xarray.h>
7 #include <uapi/linux/io_uring.h>
9 #if defined(CONFIG_IO_URING)
10 void __io_uring_cancel(bool cancel_all);
11 void __io_uring_free(struct task_struct *tsk);
12 void io_uring_unreg_ringfd(void);
13 const char *io_uring_get_opcode(u8 opcode);
14 int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags);
15 bool io_is_uring_fops(struct file *file);
17 static inline void io_uring_files_cancel(void)
19 if (current->io_uring) {
20 io_uring_unreg_ringfd();
21 __io_uring_cancel(false);
24 static inline void io_uring_task_cancel(void)
26 if (current->io_uring)
27 __io_uring_cancel(true);
29 static inline void io_uring_free(struct task_struct *tsk)
35 static inline void io_uring_task_cancel(void)
38 static inline void io_uring_files_cancel(void)
41 static inline void io_uring_free(struct task_struct *tsk)
44 static inline const char *io_uring_get_opcode(u8 opcode)
48 static inline int io_uring_cmd_sock(struct io_uring_cmd *cmd,
49 unsigned int issue_flags)
53 static inline bool io_is_uring_fops(struct file *file)