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.
@@ -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)
