mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-10 22:54:11 +08:00
3f48cf18f8
Now __io_uring_cancel() and __io_uring_files_cancel() are very similar and mostly differ by how we count requests, merge them and allow tctx_inflight() to handle counting. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/1a5986a97df4dc1378f3fe0ca1eb483dbcf42112.1618101759.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
44 lines
943 B
C
44 lines
943 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(struct files_struct *files);
|
|
void __io_uring_free(struct task_struct *tsk);
|
|
|
|
static inline void io_uring_files_cancel(struct files_struct *files)
|
|
{
|
|
if (current->io_uring)
|
|
__io_uring_cancel(files);
|
|
}
|
|
static inline void io_uring_task_cancel(void)
|
|
{
|
|
return io_uring_files_cancel(NULL);
|
|
}
|
|
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(struct files_struct *files)
|
|
{
|
|
}
|
|
static inline void io_uring_free(struct task_struct *tsk)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif
|