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;
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