Skip to content

Commit 4add705

Browse files
Dylan Yudakenaxboe
authored andcommitted
io_uring: remove io_register_submitter
this is no longer needed, as submitter_task is set at creation time. Signed-off-by: Dylan Yudaken <[email protected]> Fixes: 97bbdc0 ("io_uring: add IORING_SETUP_SINGLE_ISSUER") Signed-off-by: Jens Axboe <[email protected]>
1 parent 97c96e9 commit 4add705

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

io_uring/tctx.c

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,6 @@ __cold int io_uring_alloc_task_context(struct task_struct *task,
9191
return 0;
9292
}
9393

94-
static int io_register_submitter(struct io_ring_ctx *ctx)
95-
{
96-
int ret = 0;
97-
98-
mutex_lock(&ctx->uring_lock);
99-
if (!ctx->submitter_task)
100-
ctx->submitter_task = get_task_struct(current);
101-
else if (ctx->submitter_task != current)
102-
ret = -EEXIST;
103-
mutex_unlock(&ctx->uring_lock);
104-
105-
return ret;
106-
}
107-
10894
int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
10995
{
11096
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)
151137
{
152138
int ret;
153139

154-
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER) {
155-
ret = io_register_submitter(ctx);
156-
if (ret)
157-
return ret;
158-
}
140+
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER
141+
&& ctx->submitter_task != current)
142+
return -EEXIST;
159143

160144
ret = __io_uring_add_tctx_node(ctx);
161145
if (ret)

0 commit comments

Comments
 (0)