Fix BS_OP_DELETE (the implementation was untested up to this point)
This commit is contained in:
+12
-2
@@ -144,7 +144,7 @@ void blockstore_impl_t::loop()
|
||||
{
|
||||
dequeue_op = dequeue_read(op);
|
||||
}
|
||||
else if (op->opcode == BS_OP_WRITE || op->opcode == BS_OP_DELETE)
|
||||
else if (op->opcode == BS_OP_WRITE)
|
||||
{
|
||||
if (has_writes == 2)
|
||||
{
|
||||
@@ -154,6 +154,16 @@ void blockstore_impl_t::loop()
|
||||
dequeue_op = dequeue_write(op);
|
||||
has_writes = dequeue_op ? 1 : 2;
|
||||
}
|
||||
else if (op->opcode == BS_OP_DELETE)
|
||||
{
|
||||
if (has_writes == 2)
|
||||
{
|
||||
// Some writes could not be submitted
|
||||
break;
|
||||
}
|
||||
dequeue_op = dequeue_del(op);
|
||||
has_writes = dequeue_op ? 1 : 2;
|
||||
}
|
||||
else if (op->opcode == BS_OP_SYNC)
|
||||
{
|
||||
// wait for all small writes to be submitted
|
||||
@@ -370,7 +380,7 @@ void blockstore_impl_t::enqueue_op(blockstore_op_t *op, bool first)
|
||||
}
|
||||
};
|
||||
}
|
||||
if (op->opcode == BS_OP_WRITE && !enqueue_write(op))
|
||||
if ((op->opcode == BS_OP_WRITE || op->opcode == BS_OP_DELETE) && !enqueue_write(op))
|
||||
{
|
||||
std::function<void (blockstore_op_t*)>(op->callback)(op);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user