summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io_uring/io_uring.c7
-rw-r--r--io_uring/io_uring.h9
2 files changed, 3 insertions, 13 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index e95877398b57..39dda1b7a600 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1169,13 +1169,8 @@ int __io_run_local_work(struct io_ring_ctx *ctx, bool locked)
int ret;
unsigned int loops = 1;
- if (unlikely(ctx->submitter_task != current)) {
- /* maybe this is before any submissions */
- if (!ctx->submitter_task)
- return 0;
-
+ if (unlikely(ctx->submitter_task != current))
return -EEXIST;
- }
node = io_llist_xchg(&ctx->work_llist, &fake);
ret = 0;
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 4eea0836170e..d38173b9ac19 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -331,13 +331,8 @@ static inline struct io_kiocb *io_alloc_req(struct io_ring_ctx *ctx)
static inline bool io_allowed_run_tw(struct io_ring_ctx *ctx)
{
- if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))
- return true;
- if (unlikely(ctx->submitter_task != current)) {
- /* maybe this is before any submissions */
- return !ctx->submitter_task;
- }
- return true;
+ return likely(!(ctx->flags & IORING_SETUP_DEFER_TASKRUN) ||
+ ctx->submitter_task == current);
}
#endif