summaryrefslogtreecommitdiffstats
path: root/io_uring/tctx.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:27:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:27:49 +0000
commitace9429bb58fd418f0c81d4c2835699bddf6bde6 (patch)
treeb2d64bc10158fdd5497876388cd68142ca374ed3 /io_uring/tctx.h
parentInitial commit. (diff)
downloadlinux-c5db43d0cef8c4615d5960c43ba45e6dbd0abc00.tar.xz
linux-c5db43d0cef8c4615d5960c43ba45e6dbd0abc00.zip
Adding upstream version 6.6.15.upstream/6.6.15
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'io_uring/tctx.h')
-rw-r--r--io_uring/tctx.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/io_uring/tctx.h b/io_uring/tctx.h
new file mode 100644
index 0000000000..608e96de70
--- /dev/null
+++ b/io_uring/tctx.h
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+
+struct io_tctx_node {
+ struct list_head ctx_node;
+ struct task_struct *task;
+ struct io_ring_ctx *ctx;
+};
+
+int io_uring_alloc_task_context(struct task_struct *task,
+ struct io_ring_ctx *ctx);
+void io_uring_del_tctx_node(unsigned long index);
+int __io_uring_add_tctx_node(struct io_ring_ctx *ctx);
+int __io_uring_add_tctx_node_from_submit(struct io_ring_ctx *ctx);
+void io_uring_clean_tctx(struct io_uring_task *tctx);
+
+void io_uring_unreg_ringfd(void);
+int io_ringfd_register(struct io_ring_ctx *ctx, void __user *__arg,
+ unsigned nr_args);
+int io_ringfd_unregister(struct io_ring_ctx *ctx, void __user *__arg,
+ unsigned nr_args);
+
+/*
+ * Note that this task has used io_uring. We use it for cancelation purposes.
+ */
+static inline int io_uring_add_tctx_node(struct io_ring_ctx *ctx)
+{
+ struct io_uring_task *tctx = current->io_uring;
+
+ if (likely(tctx && tctx->last == ctx))
+ return 0;
+
+ return __io_uring_add_tctx_node_from_submit(ctx);
+}