diff options
author | 2020-06-25 18:20:54 +0300 | |
---|---|---|
committer | 2020-06-26 10:34:27 -0600 | |
commit | f4db7182e0de981a3f1b356e0cf43c6815423055 (patch) | |
tree | 430392eeccf52b8be23b84d722080e9782aa3109 /fs/io-wq.c | |
parent | io-wq: compact io-wq flags numbers (diff) | |
download | linux-f4db7182e0de981a3f1b356e0cf43c6815423055.tar.gz linux-f4db7182e0de981a3f1b356e0cf43c6815423055.tar.bz2 linux-f4db7182e0de981a3f1b356e0cf43c6815423055.zip |
io-wq: return next work from ->do_work() directly
It's easier to return next work from ->do_work() than
having an in-out argument. Looks nicer and easier to compile.
Also, merge io_wq_assign_next() into its only user.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.c')
-rw-r--r-- | fs/io-wq.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/io-wq.c b/fs/io-wq.c index 47c5f3aeb460..72f759e1d6eb 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -523,9 +523,8 @@ get_next: work->flags |= IO_WQ_WORK_CANCEL; hash = io_get_work_hash(work); - linked = old_work = work; - wq->do_work(&linked); - linked = (old_work == linked) ? NULL : linked; + old_work = work; + linked = wq->do_work(work); work = next_hashed; if (!work && linked && !io_wq_is_hashed(linked)) { @@ -781,8 +780,7 @@ static void io_run_cancel(struct io_wq_work *work, struct io_wqe *wqe) struct io_wq_work *old_work = work; work->flags |= IO_WQ_WORK_CANCEL; - wq->do_work(&work); - work = (work == old_work) ? NULL : work; + work = wq->do_work(work); wq->free_work(old_work); } while (work); } |