Check for SQEs, not for completions
Should finally fix Assertion `sqe != NULL' failed introduced after journaling refactor in 0.6.11...
This commit is contained in:
@@ -112,3 +112,11 @@ void ring_loop_t::restore(unsigned sqe_tail)
|
||||
}
|
||||
ring.sq.sqe_tail = sqe_tail;
|
||||
}
|
||||
|
||||
int ring_loop_t::sqes_left()
|
||||
{
|
||||
struct io_uring_sq *sq = &ring.sq;
|
||||
unsigned int head = io_uring_smp_load_acquire(sq->khead);
|
||||
unsigned int next = sq->sqe_tail + 1;
|
||||
return *sq->kring_entries - (next - head);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user