diff --git a/src/blockstore/blockstore_impl.cpp b/src/blockstore/blockstore_impl.cpp index 2b76e595..1715918e 100644 --- a/src/blockstore/blockstore_impl.cpp +++ b/src/blockstore/blockstore_impl.cpp @@ -275,7 +275,7 @@ void blockstore_impl_t::check_wait(blockstore_op_t *op) { if (PRIV(op)->wait_for == WAIT_SQE) { - if (ringloop->sqes_left() < PRIV(op)->wait_detail) + if (ringloop->space_left() < PRIV(op)->wait_detail) { // stop submission if there's still no free space #ifdef BLOCKSTORE_DEBUG diff --git a/src/blockstore/blockstore_internal.h b/src/blockstore/blockstore_internal.h index 65795be5..f28046e4 100644 --- a/src/blockstore/blockstore_internal.h +++ b/src/blockstore/blockstore_internal.h @@ -27,7 +27,7 @@ #define IS_INSTANT(st) (((st) & BS_ST_TYPE_MASK) == BS_ST_DELETE || ((st) & BS_ST_INSTANT)) #define BS_SUBMIT_CHECK_SQES(n) \ - if (ringloop->sqes_left() < (n))\ + if (ringloop->space_left() < (n))\ {\ /* Pause until there are more requests available */\ PRIV(op)->wait_detail = (n);\ diff --git a/src/util/ringloop.cpp b/src/util/ringloop.cpp index 72810a73..10af62f4 100644 --- a/src/util/ringloop.cpp +++ b/src/util/ringloop.cpp @@ -192,7 +192,7 @@ void ring_loop_t::restore(unsigned sqe_tail) ring.sq.sqe_tail = sqe_tail; } -int ring_loop_t::sqes_left() +unsigned ring_loop_t::space_left() { struct io_uring_sq *sq = &ring.sq; unsigned int head = io_uring_smp_load_acquire(sq->khead); diff --git a/src/util/ringloop.h b/src/util/ringloop.h index e40c9033..c397461f 100644 --- a/src/util/ringloop.h +++ b/src/util/ringloop.h @@ -68,11 +68,7 @@ public: struct io_uring_cqe *cqe; return io_uring_wait_cqe(&ring, &cqe); } - int sqes_left(); - inline unsigned space_left() - { - return free_ring_data_ptr; - } + unsigned space_left(); inline bool has_work() { return loop_again;