io_uring: combine cq_wait_nr checks
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 17 Jan 2024 00:57:29 +0000 (00:57 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Jan 2024 16:45:24 +0000 (09:45 -0700)
commitb4bc35cf8704db86203c0739711dab1804265bf3
treec77cddf0ab6b496c383bf55b81940bfa3e3246d8
parente8c407717b4814dac5641d93cbbbb9fc394f7cf0
io_uring: combine cq_wait_nr checks

Instead of explicitly checking ->cq_wait_nr for whether there are
waiting, which is currently represented by 0, we can store there a
large value and the nr_tw will automatically filter out those cases.
Add a named constant for that and for the wake up bias value.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/38def30282654d980673976cd42fde9bab19b297.1705438669.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c