[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220926170927.3309091-4-dylany@fb.com>
Date: Mon, 26 Sep 2022 10:09:27 -0700
From: Dylan Yudaken <dylany@...com>
To: Jens Axboe <axboe@...nel.dk>,
Pavel Begunkov <asml.silence@...il.com>
CC: <io-uring@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kernel-team@...com>, Dylan Yudaken <dylany@...com>
Subject: [PATCH v2 3/3] io_uring: remove io_register_submitter
this is no longer needed, as submitter_task is set at creation time.
Signed-off-by: Dylan Yudaken <dylany@...com>
---
io_uring/tctx.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/io_uring/tctx.c b/io_uring/tctx.c
index dd0205fcdb13..4324b1cf1f6a 100644
--- a/io_uring/tctx.c
+++ b/io_uring/tctx.c
@@ -91,20 +91,6 @@ __cold int io_uring_alloc_task_context(struct task_struct *task,
return 0;
}
-static int io_register_submitter(struct io_ring_ctx *ctx)
-{
- int ret = 0;
-
- mutex_lock(&ctx->uring_lock);
- if (!ctx->submitter_task)
- ctx->submitter_task = get_task_struct(current);
- else if (ctx->submitter_task != current)
- ret = -EEXIST;
- mutex_unlock(&ctx->uring_lock);
-
- return ret;
-}
-
int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
{
struct io_uring_task *tctx = current->io_uring;
@@ -151,11 +137,9 @@ int __io_uring_add_tctx_node_from_submit(struct io_ring_ctx *ctx)
{
int ret;
- if (ctx->flags & IORING_SETUP_SINGLE_ISSUER) {
- ret = io_register_submitter(ctx);
- if (ret)
- return ret;
- }
+ if (ctx->flags & IORING_SETUP_SINGLE_ISSUER
+ && ctx->submitter_task != current)
+ return -EEXIST;
ret = __io_uring_add_tctx_node(ctx);
if (ret)
--
2.30.2
Powered by blists - more mailing lists