mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-14 16:23:51 +08:00
f552a27afe
When doing cancellation, we use a parameter to indicate where it's from do_exit or exec. So a boolean value is good enough for this, remove the struct files* as it is not necessary. Signed-off-by: Hao Xu <haoxu@linux.alibaba.com> [axboe: fixup io_uring_files_cancel for !CONFIG_IO_URING] Signed-off-by: Jens Axboe <axboe@kernel.dk>
45 lines
902 B
C
45 lines
902 B
C
/* 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>
|
|
|
|
#if defined(CONFIG_IO_URING)
|
|
struct sock *io_uring_get_socket(struct file *file);
|
|
void __io_uring_cancel(bool cancel_all);
|
|
void __io_uring_free(struct task_struct *tsk);
|
|
|
|
static inline void io_uring_files_cancel(void)
|
|
{
|
|
if (current->io_uring)
|
|
__io_uring_cancel(false);
|
|
}
|
|
static inline void io_uring_task_cancel(void)
|
|
{
|
|
if (current->io_uring)
|
|
__io_uring_cancel(true);
|
|
}
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
{
|
|
if (tsk->io_uring)
|
|
__io_uring_free(tsk);
|
|
}
|
|
#else
|
|
static inline struct sock *io_uring_get_socket(struct file *file)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void io_uring_task_cancel(void)
|
|
{
|
|
}
|
|
static inline void io_uring_files_cancel(void)
|
|
{
|
|
}
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif
|