io_uring: refactor io_cqring_wait
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 4 Feb 2021 13:51:58 +0000 (13:51 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Feb 2021 15:05:46 +0000 (08:05 -0700)
commiteeb60b9ab4000d20261973642dfc9fb0e4b5d073
treefc4101dcc7c860897ea716bc08693eee49ecdc25
parentc1d5a224683b333ddbe278e455d639ccd4f5ca2b
io_uring: refactor io_cqring_wait

It's easy to make a mistake in io_cqring_wait() because for all
break/continue clauses we need to watch for prepare/finish_wait to be
used correctly. Extract all those into a new helper
io_cqring_wait_schedule(), and transforming the loop into simple series
of func calls: prepare(); check_and_schedule(); finish();

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