summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2019-11-21 23:21:01 +0300
committerJens Axboe <axboe@kernel.dk>2019-11-25 19:56:11 -0700
commit944e58bfeda0e9b97cd611adafc823c78e0bc464 (patch)
tree42051264e417dc43f159e704eb8138ccb1840eda /fs
parent70cf9f3270a5c5148e93a526dc1e51965259e70c (diff)
io_uring: pass only !null to io_req_find_next()
Make io_req_find_next() and io_req_link_next() to accept only non-null nxt, and handle it in callers. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 6d8665e8f0e8..95deb45e89cf 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -908,7 +908,7 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
* in this context instead of having to queue up new async work.
*/
if (nxt) {
- if (nxtptr && io_wq_current_is_worker())
+ if (io_wq_current_is_worker())
*nxtptr = nxt;
else
io_queue_async_work(nxt);
@@ -986,8 +986,13 @@ static void io_req_find_next(struct io_kiocb *req, struct io_kiocb **nxt)
static void io_free_req(struct io_kiocb *req)
{
- io_req_find_next(req, NULL);
+ struct io_kiocb *nxt = NULL;
+
+ io_req_find_next(req, &nxt);
__io_free_req(req);
+
+ if (nxt)
+ io_queue_async_work(nxt);
}
/*