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_wq_work_node {
26 struct io_wq_work_node *next;
29 struct io_wq_work_list {
30 struct io_wq_work_node *first;
31 struct io_wq_work_node *last;
34 struct io_uring_task {
37 struct wait_queue_head wait;
39 struct percpu_counter inflight;
40 struct io_identity __identity;
41 struct io_identity *identity;
46 struct io_wq_work_list task_list;
47 unsigned long task_state;
48 struct callback_head task_work;
51 #if defined(CONFIG_IO_URING)
52 struct sock *io_uring_get_socket(struct file *file);
53 void __io_uring_task_cancel(void);
54 void __io_uring_files_cancel(struct files_struct *files);
55 void __io_uring_free(struct task_struct *tsk);
57 static inline void io_uring_task_cancel(void)
59 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
60 __io_uring_task_cancel();
62 static inline void io_uring_files_cancel(struct files_struct *files)
64 if (current->io_uring && !xa_empty(¤t->io_uring->xa))
65 __io_uring_files_cancel(files);
67 static inline void io_uring_free(struct task_struct *tsk)
73 static inline struct sock *io_uring_get_socket(struct file *file)
77 static inline void io_uring_task_cancel(void)
80 static inline void io_uring_files_cancel(struct files_struct *files)
83 static inline void io_uring_free(struct task_struct *tsk)