io_uring: simplify io_task_match()
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 6 Nov 2020 13:00:21 +0000 (13:00 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Dec 2020 19:04:00 +0000 (12:04 -0700)
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>
fs/io_uring.c

index 12a213b..baff813 100644 (file)
@@ -1563,11 +1563,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);
 }
 
 /*