io_uring: don't mark link's head for_async
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 27 Jun 2020 11:04:57 +0000 (14:04 +0300)
committerJens Axboe <axboe@kernel.dk>
Sun, 28 Jun 2020 14:10:17 +0000 (08:10 -0600)
No reason to mark a head of a link as for-async in io_req_defer_prep().
grab_env(), etc. That will be done further during submission if
neccessary.

Mark for_async=false saving extra grab_env() in many cases.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 658949bed77fe5e2a2f8b2f5ad66332c595e8216..545b137c7b4a265faee8222207676d36c94df307 100644 (file)
@@ -6092,7 +6092,7 @@ static int io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
                        if (io_alloc_async_ctx(req))
                                return -EAGAIN;
 
-                       ret = io_req_defer_prep(req, sqe, true);
+                       ret = io_req_defer_prep(req, sqe, false);
                        if (ret)
                                req->flags |= REQ_F_FAIL_LINK;
                        *link = req;