Merge tag 'pci-v6.16-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
[linux-block.git] / include / linux / io_uring.h
CommitLineData
0f212204
JA
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>
a9216fac 7#include <uapi/linux/io_uring.h>
98447d65 8
0f212204 9#if defined(CONFIG_IO_URING)
f552a27a 10void __io_uring_cancel(bool cancel_all);
0f212204 11void __io_uring_free(struct task_struct *tsk);
e7a6c00d 12void io_uring_unreg_ringfd(void);
33337d03 13const char *io_uring_get_opcode(u8 opcode);
a4104821 14bool io_is_uring_fops(struct file *file);
0f212204 15
f552a27a 16static inline void io_uring_files_cancel(void)
0f212204 17{
12d90811 18 if (current->io_uring)
f552a27a 19 __io_uring_cancel(false);
0f212204 20}
3f48cf18 21static inline void io_uring_task_cancel(void)
0f212204 22{
a4aadd11 23 if (current->io_uring)
f552a27a 24 __io_uring_cancel(true);
0f212204
JA
25}
26static inline void io_uring_free(struct task_struct *tsk)
27{
28 if (tsk->io_uring)
29 __io_uring_free(tsk);
30}
31#else
32static inline void io_uring_task_cancel(void)
33{
34}
f552a27a 35static inline void io_uring_files_cancel(void)
0f212204
JA
36{
37}
38static inline void io_uring_free(struct task_struct *tsk)
39{
40}
33337d03
DY
41static inline const char *io_uring_get_opcode(u8 opcode)
42{
43 return "";
44}
a4104821
JA
45static inline bool io_is_uring_fops(struct file *file)
46{
47 return false;
48}
0f212204
JA
49#endif
50
51#endif