io_uring: simplify io_task_match()

[ Upstream commit 06de5f5973c641c7ae033f133ecfaaf64fe633a6 ]

If IORING_SETUP_SQPOLL is set all requests belong to the corresponding
SQPOLL task, so skip task checking in that case and always match.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Pavel Begunkov 2021-02-09 04:47:35 +00:00 committed by Greg Kroah-Hartman
parent 2d18b3ee63
commit fe9334186a

View File

@ -1472,11 +1472,7 @@ static bool io_task_match(struct io_kiocb *req, struct task_struct *tsk)
if (!tsk || req->task == tsk)
return true;
if (ctx->flags & IORING_SETUP_SQPOLL) {
if (ctx->sq_data && req->task == ctx->sq_data->thread)
return true;
}
return false;
return (ctx->flags & IORING_SETUP_SQPOLL);
}
/*