io_uring: consolidate CQ nr events calculation
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 17 Dec 2020 00:24:37 +0000 (00:24 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Dec 2020 15:40:52 +0000 (08:40 -0700)
commite23de15fdbd3070446b2d212373c0ae556f63d93
tree2cd3742152ed775b029405d138a7b7aaae97e7fa
parent9cd2be519d05ee78876d55e8e902b7125f78b74f
io_uring: consolidate CQ nr events calculation

Add a helper which calculates number of events in CQ. Handcoded version
of it in io_cqring_overflow_flush() is not the clearest thing, so it
makes it slightly more readable.

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