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>
9 struct files_struct *files;
11 #ifdef CONFIG_BLK_CGROUP
12 struct cgroup_subsys_state *blkcg_css;
14 const struct cred *creds;
15 struct nsproxy *nsproxy;
21 struct io_uring_task {
24 struct wait_queue_head wait;
26 atomic_long_t req_issue;
29 bool in_idle ____cacheline_aligned_in_smp;
30 atomic_long_t req_complete;
33 #if defined(CONFIG_IO_URING)
34 struct sock *io_uring_get_socket(struct file *file);
35 void __io_uring_task_cancel(void);
36 void __io_uring_files_cancel(struct files_struct *files);
37 void __io_uring_free(struct task_struct *tsk);
39 static inline void io_uring_task_cancel(void)
41 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
42 __io_uring_task_cancel();
44 static inline void io_uring_files_cancel(struct files_struct *files)
46 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
47 __io_uring_files_cancel(files);
49 static inline void io_uring_free(struct task_struct *tsk)
55 static inline struct sock *io_uring_get_socket(struct file *file)
59 static inline void io_uring_task_cancel(void)
62 static inline void io_uring_files_cancel(struct files_struct *files)
65 static inline void io_uring_free(struct task_struct *tsk)