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> | |
98447d65 | 7 | |
0f212204 | 8 | #if defined(CONFIG_IO_URING) |
a3ec6005 | 9 | struct sock *io_uring_get_socket(struct file *file); |
f552a27a | 10 | void __io_uring_cancel(bool cancel_all); |
0f212204 JA |
11 | void __io_uring_free(struct task_struct *tsk); |
12 | ||
f552a27a | 13 | static inline void io_uring_files_cancel(void) |
0f212204 | 14 | { |
8452d4a6 | 15 | if (current->io_uring) |
f552a27a | 16 | __io_uring_cancel(false); |
0f212204 | 17 | } |
3f48cf18 | 18 | static inline void io_uring_task_cancel(void) |
0f212204 | 19 | { |
a4aadd11 | 20 | if (current->io_uring) |
f552a27a | 21 | __io_uring_cancel(true); |
0f212204 JA |
22 | } |
23 | static inline void io_uring_free(struct task_struct *tsk) | |
24 | { | |
25 | if (tsk->io_uring) | |
26 | __io_uring_free(tsk); | |
27 | } | |
28 | #else | |
a3ec6005 JA |
29 | static inline struct sock *io_uring_get_socket(struct file *file) |
30 | { | |
31 | return NULL; | |
32 | } | |
0f212204 JA |
33 | static inline void io_uring_task_cancel(void) |
34 | { | |
35 | } | |
f552a27a | 36 | static inline void io_uring_files_cancel(void) |
0f212204 JA |
37 | { |
38 | } | |
39 | static inline void io_uring_free(struct task_struct *tsk) | |
40 | { | |
41 | } | |
42 | #endif | |
43 | ||
44 | #endif |