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;
20 unsigned int sessionid;
25 struct io_uring_task {
28 struct wait_queue_head wait;
30 struct percpu_counter inflight;
31 struct io_identity __identity;
32 struct io_identity *identity;
36 #if defined(CONFIG_IO_URING)
37 struct sock *io_uring_get_socket(struct file *file);
38 void __io_uring_task_cancel(void);
39 void __io_uring_files_cancel(struct files_struct *files);
40 void __io_uring_free(struct task_struct *tsk);
42 static inline void io_uring_task_cancel(void)
44 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
45 __io_uring_task_cancel();
47 static inline void io_uring_files_cancel(struct files_struct *files)
49 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
50 __io_uring_files_cancel(files);
52 static inline void io_uring_free(struct task_struct *tsk)
58 static inline struct sock *io_uring_get_socket(struct file *file)
62 static inline void io_uring_task_cancel(void)
65 static inline void io_uring_files_cancel(struct files_struct *files)
68 static inline void io_uring_free(struct task_struct *tsk)