Check for op->wait_for conditions

It's almost identical to just re-submit... so maybe it was pointless
This commit is contained in:
Vitaliy Filippov
2019-11-08 12:08:25 +03:00
parent a5f2d8b85e
commit 90f081f398
3 changed files with 79 additions and 22 deletions
+5 -1
View File
@@ -23,6 +23,7 @@ int blockstore::dequeue_write(blockstore_operation *op)
{
// Pause until there are more requests available
op->wait_for = WAIT_SQE;
op->wait_detail = 1;
return 0;
}
struct ring_data_t *data = ((ring_data_t*)sqe->user_data);
@@ -67,15 +68,18 @@ int blockstore::dequeue_write(blockstore_operation *op)
{
// No space in the journal. Wait for it.
op->wait_for = WAIT_JOURNAL;
op->wait_detail = next_pos - journal.used_start;
op->wait_detail = next_pos;
return 0;
}
// There is sufficient space. Get SQE(s)
unsigned prev_sqe_pos = ringloop->ring->sq.sqe_tail;
struct io_uring_sqe *sqe1 = get_sqe(), *sqe2 = two_sqes ? get_sqe() : NULL;
if (!sqe1 || two_sqes && !sqe2)
{
// Pause until there are more requests available
op->wait_for = WAIT_SQE;
op->wait_detail = two_sqes ? 2 : 1;
ringloop->ring->sq.sqe_tail = prev_sqe_pos;
return 0;
}
struct ring_data_t *data1 = ((ring_data_t*)sqe1->user_data);