forked from vitalif/vitastor
Check for SQEs, not for completions
Should finally fix Assertion `sqe != NULL' failed introduced after journaling refactor in 0.6.11...non-odp-rdma
parent
eb5d9153e8
commit
d9857a5340
|
@ -55,7 +55,7 @@
|
||||||
#define IS_DELETE(st) (((st) & 0x0F) == BS_ST_DELETE)
|
#define IS_DELETE(st) (((st) & 0x0F) == BS_ST_DELETE)
|
||||||
|
|
||||||
#define BS_SUBMIT_CHECK_SQES(n) \
|
#define BS_SUBMIT_CHECK_SQES(n) \
|
||||||
if (ringloop->space_left() < (n))\
|
if (ringloop->sqes_left() < (n))\
|
||||||
{\
|
{\
|
||||||
/* Pause until there are more requests available */\
|
/* Pause until there are more requests available */\
|
||||||
PRIV(op)->wait_for = WAIT_SQE;\
|
PRIV(op)->wait_for = WAIT_SQE;\
|
||||||
|
|
|
@ -112,3 +112,11 @@ void ring_loop_t::restore(unsigned sqe_tail)
|
||||||
}
|
}
|
||||||
ring.sq.sqe_tail = 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);
|
||||||
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@ public:
|
||||||
struct io_uring_cqe *cqe;
|
struct io_uring_cqe *cqe;
|
||||||
return io_uring_wait_cqe(&ring, &cqe);
|
return io_uring_wait_cqe(&ring, &cqe);
|
||||||
}
|
}
|
||||||
|
int sqes_left();
|
||||||
inline unsigned space_left()
|
inline unsigned space_left()
|
||||||
{
|
{
|
||||||
return free_ring_data_ptr;
|
return free_ring_data_ptr;
|
||||||
|
|
Loading…
Reference in New Issue