src/queue: control kernel enter with a var

We check twice for all entering conditions in _io_uring_get_cqe(), first
to set flags, and the second to potentially break the loop. Save it into
a need_enter var.

Also, don't set IORING_ENTER_GETEVENTS when there is already enough of
events in the CQ.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed