2020-09-13 22:09:39 +03: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 19:48:51 +03:00
|
|
|
|
2020-09-13 22:09:39 +03:00
|
|
|
#if defined(CONFIG_IO_URING)
|
2020-09-19 05:41:00 +03:00
|
|
|
struct sock *io_uring_get_socket(struct file *file);
|
2021-04-11 03:46:27 +03:00
|
|
|
void __io_uring_cancel(struct files_struct *files);
|
2020-09-13 22:09:39 +03:00
|
|
|
void __io_uring_free(struct task_struct *tsk);
|
|
|
|
|
2021-04-11 03:46:27 +03:00
|
|
|
static inline void io_uring_files_cancel(struct files_struct *files)
|
2020-09-13 22:09:39 +03:00
|
|
|
{
|
2021-02-27 14:16:46 +03:00
|
|
|
if (current->io_uring)
|
2021-04-11 03:46:27 +03:00
|
|
|
__io_uring_cancel(files);
|
2020-09-13 22:09:39 +03:00
|
|
|
}
|
2021-04-11 03:46:27 +03:00
|
|
|
static inline void io_uring_task_cancel(void)
|
2020-09-13 22:09:39 +03:00
|
|
|
{
|
2021-04-11 03:46:27 +03:00
|
|
|
return io_uring_files_cancel(NULL);
|
2020-09-13 22:09:39 +03:00
|
|
|
}
|
|
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
if (tsk->io_uring)
|
|
|
|
__io_uring_free(tsk);
|
|
|
|
}
|
|
|
|
#else
|
2020-09-19 05:41:00 +03:00
|
|
|
static inline struct sock *io_uring_get_socket(struct file *file)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-09-13 22:09:39 +03:00
|
|
|
static inline void io_uring_task_cancel(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline void io_uring_files_cancel(struct files_struct *files)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|