Don't cap wait_nr in __io_uring_submit()

wait_nr is capped to the number of submitted sqes which ignores possible
items submitted in previous calls. Removing this cap allows us to wait for
any number of completions no matter when they were submitted.

Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Hrvoje Zeba
2019-11-25 09:44:19 -07:00
committed by Jens Axboe
parent f0d57a101b
commit b5837bd531
+1 -4
View File
@@ -175,11 +175,8 @@ static int __io_uring_submit(struct io_uring *ring, unsigned submitted,
flags = 0;
if (wait_nr || sq_ring_needs_enter(ring, &flags)) {
if (wait_nr) {
if (wait_nr > submitted)
wait_nr = submitted;
if (wait_nr)
flags |= IORING_ENTER_GETEVENTS;
}
ret = io_uring_enter(ring->ring_fd, submitted, wait_nr, flags,
NULL);