summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-11-22 09:18:34 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-22 09:18:34 -0700
commitc5bc0ed798e0e79b343b5e438373e71819e6937f (patch)
treedddae5bf03b277b8606de321cacc19cb884ccf1b
parentb7d7554397639ad650ae2cbcad8dade6786018ff (diff)
downloadliburing-c5bc0ed798e0e79b343b5e438373e71819e6937f.tar.gz
liburing-c5bc0ed798e0e79b343b5e438373e71819e6937f.tar.bz2
Fix io_uring_sq_ready()
This is supposed to return the entries that are actually in the SQ ring, not the liburing copy. This fixes an issue where if you fail to submit IO the first time (eg got -EBUSY), then a subsequent submit would think we had nothing to submit. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 74302e6..a2e8f94 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -297,7 +297,7 @@ static inline void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
static inline unsigned io_uring_sq_ready(struct io_uring *ring)
{
- return ring->sq.sqe_tail - ring->sq.sqe_head;
+ return *ring->sq.ktail - *ring->sq.khead;
}
static inline unsigned io_uring_sq_space_left(struct io_uring *ring)