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;
37 #if defined(CONFIG_IO_URING)
38 struct sock *io_uring_get_socket(struct file *file);
39 void __io_uring_task_cancel(void);
40 void __io_uring_files_cancel(struct files_struct *files);
41 void __io_uring_free(struct task_struct *tsk);
43 static inline void io_uring_task_cancel(void)
45 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
46 __io_uring_task_cancel();
48 static inline void io_uring_files_cancel(struct files_struct *files)
50 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
51 __io_uring_files_cancel(files);
53 static inline void io_uring_free(struct task_struct *tsk)
59 static inline struct sock *io_uring_get_socket(struct file *file)
63 static inline void io_uring_task_cancel(void)
66 static inline void io_uring_files_cancel(struct files_struct *files)
69 static inline void io_uring_free(struct task_struct *tsk)