io_uring: dedup CQE flushing non-empty checks
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 8 Sep 2021 15:40:52 +0000 (16:40 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Oct 2021 11:49:52 +0000 (05:49 -0600)
commitc450178d9be9dc44327f3b526f82c36e4c5d362b
tree0afe93d2fd482987d6dd2fb762808e9d0e02d256
parentd81499bfcd471e6b920683f8fcf06ce65f84286b
io_uring: dedup CQE flushing non-empty checks

We don't do io_submit_flush_completions() when there is no requests
enqueued, and every single caller checks for it. Hide that check into
the function not forgetting about inlining. That will make it much
easier for changing the empty check condition in the future.

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