io_uring: remove files pointer in cancellation functions
Bugzilla: https://bugzilla.redhat.com/2120352 commit f552a27afe67f05c47bb0c33b92af2a23b684c31 Author: Hao Xu <haoxu@linux.alibaba.com> Date: Thu Aug 12 12:14:35 2021 +0800 io_uring: remove files pointer in cancellation functions 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> Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
This commit is contained in:
parent
fdcf7eaafa
commit
fde778f2ad
|
@ -9242,9 +9242,9 @@ static void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd)
|
|||
}
|
||||
}
|
||||
|
||||
void __io_uring_cancel(struct files_struct *files)
|
||||
void __io_uring_cancel(bool cancel_all)
|
||||
{
|
||||
io_uring_cancel_generic(!files, NULL);
|
||||
io_uring_cancel_generic(cancel_all, NULL);
|
||||
}
|
||||
|
||||
static void *io_uring_validate_mmap_request(struct file *file,
|
||||
|
|
|
@ -7,18 +7,18 @@
|
|||
|
||||
#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_cancel(bool cancel_all);
|
||||
void __io_uring_free(struct task_struct *tsk);
|
||||
|
||||
static inline void io_uring_files_cancel(struct files_struct *files)
|
||||
static inline void io_uring_files_cancel(void)
|
||||
{
|
||||
if (current->io_uring)
|
||||
__io_uring_cancel(files);
|
||||
__io_uring_cancel(false);
|
||||
}
|
||||
static inline void io_uring_task_cancel(void)
|
||||
{
|
||||
if (current->io_uring)
|
||||
__io_uring_cancel(NULL);
|
||||
__io_uring_cancel(true);
|
||||
}
|
||||
static inline void io_uring_free(struct task_struct *tsk)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ static inline struct sock *io_uring_get_socket(struct file *file)
|
|||
static inline void io_uring_task_cancel(void)
|
||||
{
|
||||
}
|
||||
static inline void io_uring_files_cancel(struct files_struct *files)
|
||||
static inline void io_uring_files_cancel(void)
|
||||
{
|
||||
}
|
||||
static inline void io_uring_free(struct task_struct *tsk)
|
||||
|
|
|
@ -778,7 +778,7 @@ void __noreturn do_exit(long code)
|
|||
schedule();
|
||||
}
|
||||
|
||||
io_uring_files_cancel(tsk->files);
|
||||
io_uring_files_cancel();
|
||||
exit_signals(tsk); /* sets PF_EXITING */
|
||||
|
||||
/* sync mm's RSS info before statistics gathering */
|
||||
|
|
Loading…
Reference in New Issue