2020-09-13 19:09:39 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#ifndef _LINUX_IO_URING_H
|
|
|
|
#define _LINUX_IO_URING_H
|
|
|
|
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/xarray.h>
|
2020-10-14 16:48:51 +00:00
|
|
|
|
2020-09-13 19:09:39 +00:00
|
|
|
#if defined(CONFIG_IO_URING)
|
2020-09-19 02:41:00 +00:00
|
|
|
struct sock *io_uring_get_socket(struct file *file);
|
2021-08-12 04:14:35 +00:00
|
|
|
void __io_uring_cancel(bool cancel_all);
|
2020-09-13 19:09:39 +00:00
|
|
|
void __io_uring_free(struct task_struct *tsk);
|
|
|
|
|
2021-08-12 04:14:35 +00:00
|
|
|
static inline void io_uring_files_cancel(void)
|
2020-09-13 19:09:39 +00:00
|
|
|
{
|
2021-02-27 11:16:46 +00:00
|
|
|
if (current->io_uring)
|
2021-08-12 04:14:35 +00:00
|
|
|
__io_uring_cancel(false);
|
2020-09-13 19:09:39 +00:00
|
|
|
}
|
2021-04-11 00:46:27 +00:00
|
|
|
static inline void io_uring_task_cancel(void)
|
2020-09-13 19:09:39 +00:00
|
|
|
{
|
2021-08-12 04:14:34 +00:00
|
|
|
if (current->io_uring)
|
2021-08-12 04:14:35 +00:00
|
|
|
__io_uring_cancel(true);
|
2020-09-13 19:09:39 +00:00
|
|
|
}
|
|
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
if (tsk->io_uring)
|
|
|
|
__io_uring_free(tsk);
|
|
|
|
}
|
|
|
|
#else
|
2020-09-19 02:41:00 +00:00
|
|
|
static inline struct sock *io_uring_get_socket(struct file *file)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-09-13 19:09:39 +00:00
|
|
|
static inline void io_uring_task_cancel(void)
|
|
|
|
{
|
|
|
|
}
|
2021-08-12 04:14:35 +00:00
|
|
|
static inline void io_uring_files_cancel(void)
|
2020-09-13 19:09:39 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|