OSDN Git Service

io_uring: simplify io_req_link_next()
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 21 Nov 2019 20:21:02 +0000 (23:21 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:11 +0000 (19:56 -0700)
"if (nxt)" is always true, as it was checked in the while's condition.
io_wq_current_is_worker() is unnecessary, as non-async callers don't
pass nxt, so io_queue_async_work() will be called for them anyway.

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

index 95deb45..f6f5871 100644 (file)
@@ -903,16 +903,7 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
                        nxt->flags |= REQ_F_LINK;
                }
 
-               /*
-                * If we're in async work, we can continue processing the chain
-                * in this context instead of having to queue up new async work.
-                */
-               if (nxt) {
-                       if (io_wq_current_is_worker())
-                               *nxtptr = nxt;
-                       else
-                               io_queue_async_work(nxt);
-               }
+               *nxtptr = nxt;
                break;
        }