summaryrefslogtreecommitdiff
path: root/include/linux/io_uring.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-04-11 03:46:27 +0300
committerJens Axboe <axboe@kernel.dk>2021-04-12 04:30:41 +0300
commit3f48cf18f886c97a7e775af10696bfed9ddcff31 (patch)
tree00d78698ad48b43a7076c32e22da7ad77c106ecc /include/linux/io_uring.h
parentb303fe2e5a3802b0b1fb8d997e5c9caef48f6dd8 (diff)
downloadlinux-3f48cf18f886c97a7e775af10696bfed9ddcff31.tar.xz
io_uring: unify files and task cancel
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>
Diffstat (limited to 'include/linux/io_uring.h')
-rw-r--r--include/linux/io_uring.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/io_uring.h b/include/linux/io_uring.h
index 79cde9906be0..04b650bcbbe5 100644
--- a/include/linux/io_uring.h
+++ b/include/linux/io_uring.h
@@ -7,19 +7,17 @@
#if defined(CONFIG_IO_URING)
struct sock *io_uring_get_socket(struct file *file);
-void __io_uring_task_cancel(void);
-void __io_uring_files_cancel(struct files_struct *files);
+void __io_uring_cancel(struct files_struct *files);
void __io_uring_free(struct task_struct *tsk);
-static inline void io_uring_task_cancel(void)
+static inline void io_uring_files_cancel(struct files_struct *files)
{
if (current->io_uring)
- __io_uring_task_cancel();
+ __io_uring_cancel(files);
}
-static inline void io_uring_files_cancel(struct files_struct *files)
+static inline void io_uring_task_cancel(void)
{
- if (current->io_uring)
- __io_uring_files_cancel(files);
+ return io_uring_files_cancel(NULL);
}
static inline void io_uring_free(struct task_struct *tsk)
{