Commit | Line | Data |
---|---|---|
0f212204 JA |
1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
2 | #ifndef _LINUX_IO_URING_H | |
3 | #define _LINUX_IO_URING_H | |
4 | ||
5 | #include <linux/sched.h> | |
6 | #include <linux/xarray.h> | |
a9216fac | 7 | #include <uapi/linux/io_uring.h> |
98447d65 | 8 | |
0f212204 | 9 | #if defined(CONFIG_IO_URING) |
f552a27a | 10 | void __io_uring_cancel(bool cancel_all); |
0f212204 | 11 | void __io_uring_free(struct task_struct *tsk); |
e7a6c00d | 12 | void io_uring_unreg_ringfd(void); |
33337d03 | 13 | const char *io_uring_get_opcode(u8 opcode); |
a4104821 | 14 | bool io_is_uring_fops(struct file *file); |
0f212204 | 15 | |
f552a27a | 16 | static inline void io_uring_files_cancel(void) |
0f212204 | 17 | { |
12d90811 | 18 | if (current->io_uring) |
f552a27a | 19 | __io_uring_cancel(false); |
0f212204 | 20 | } |
3f48cf18 | 21 | static inline void io_uring_task_cancel(void) |
0f212204 | 22 | { |
a4aadd11 | 23 | if (current->io_uring) |
f552a27a | 24 | __io_uring_cancel(true); |
0f212204 JA |
25 | } |
26 | static inline void io_uring_free(struct task_struct *tsk) | |
27 | { | |
28 | if (tsk->io_uring) | |
29 | __io_uring_free(tsk); | |
30 | } | |
31 | #else | |
32 | static inline void io_uring_task_cancel(void) | |
33 | { | |
34 | } | |
f552a27a | 35 | static inline void io_uring_files_cancel(void) |
0f212204 JA |
36 | { |
37 | } | |
38 | static inline void io_uring_free(struct task_struct *tsk) | |
39 | { | |
40 | } | |
33337d03 DY |
41 | static inline const char *io_uring_get_opcode(u8 opcode) |
42 | { | |
43 | return ""; | |
44 | } | |
a4104821 JA |
45 | static inline bool io_is_uring_fops(struct file *file) |
46 | { | |
47 | return false; | |
48 | } | |
0f212204 JA |
49 | #endif |
50 | ||
51 | #endif |