]> Git Repo - J-linux.git/blob - include/linux/io_uring.h
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / include / linux / io_uring.h
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>
7 #include <uapi/linux/io_uring.h>
8
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 bool io_is_uring_fops(struct file *file);
15
16 static inline void io_uring_files_cancel(void)
17 {
18         if (current->io_uring)
19                 __io_uring_cancel(false);
20 }
21 static inline void io_uring_task_cancel(void)
22 {
23         if (current->io_uring)
24                 __io_uring_cancel(true);
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 }
35 static inline void io_uring_files_cancel(void)
36 {
37 }
38 static inline void io_uring_free(struct task_struct *tsk)
39 {
40 }
41 static inline const char *io_uring_get_opcode(u8 opcode)
42 {
43         return "";
44 }
45 static inline bool io_is_uring_fops(struct file *file)
46 {
47         return false;
48 }
49 #endif
50
51 #endif
This page took 0.043207 seconds and 4 git commands to generate.