summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHrvoje Zeba <zeba.hrvoje@gmail.com>2019-11-25 09:44:19 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-25 09:44:19 -0700
commitb5837bd5311d5f0cbc581ff7a492600f6a8d9812 (patch)
tree9367bac0ea2cc592ff6c967945652bbf6c687f0f
parentf0d57a101ba39d0a0796622843fd08819ca5a6d0 (diff)
downloadliburing-b5837bd5311d5f0cbc581ff7a492600f6a8d9812.tar.gz
liburing-b5837bd5311d5f0cbc581ff7a492600f6a8d9812.tar.bz2
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>
-rw-r--r--src/queue.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/queue.c b/src/queue.c
index 12abab2..4f6fd67 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -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);