Fix pending_ops
This commit is contained in:
@@ -166,6 +166,7 @@ void blockstore_impl_t::loop()
|
|||||||
}
|
}
|
||||||
if (wr_st == 0)
|
if (wr_st == 0)
|
||||||
{
|
{
|
||||||
|
PRIV(op)->pending_ops = 0;
|
||||||
ringloop->restore(prev_sqe_pos);
|
ringloop->restore(prev_sqe_pos);
|
||||||
if (PRIV(op)->wait_for == WAIT_SQE)
|
if (PRIV(op)->wait_for == WAIT_SQE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
||||||
{
|
{
|
||||||
|
int op_state = PRIV(op)->op_state;
|
||||||
|
if (op_state == 1) goto resume_1;
|
||||||
|
if (op_state == 2) goto resume_2;
|
||||||
|
assert(!op_state);
|
||||||
if (immediate_commit == IMMEDIATE_ALL || !unsynced_big_write_count && !unsynced_small_write_count)
|
if (immediate_commit == IMMEDIATE_ALL || !unsynced_big_write_count && !unsynced_small_write_count)
|
||||||
{
|
{
|
||||||
// We can return immediately because sync is only dequeued after all previous writes
|
// We can return immediately because sync is only dequeued after all previous writes
|
||||||
@@ -14,10 +18,6 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
|||||||
FINISH_OP(op);
|
FINISH_OP(op);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
int op_state = PRIV(op)->op_state;
|
|
||||||
if (op_state == 1) goto resume_1;
|
|
||||||
if (op_state == 2) goto resume_2;
|
|
||||||
assert(!op_state);
|
|
||||||
stop_sync_submitted = false;
|
stop_sync_submitted = false;
|
||||||
if (unsynced_small_write_count > 0 && !disable_journal_fsync)
|
if (unsynced_small_write_count > 0 && !disable_journal_fsync)
|
||||||
{
|
{
|
||||||
@@ -28,7 +28,7 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
|||||||
data->callback = [this, op](ring_data_t *data) { handle_write_event(data, op); };
|
data->callback = [this, op](ring_data_t *data) { handle_write_event(data, op); };
|
||||||
PRIV(op)->pending_ops++;
|
PRIV(op)->pending_ops++;
|
||||||
}
|
}
|
||||||
if (!disable_meta_fsync)
|
if (!disable_meta_fsync && dsk.meta_fd != dsk.journal_fd)
|
||||||
{
|
{
|
||||||
// fsync meta
|
// fsync meta
|
||||||
BS_SUBMIT_GET_SQE(sqe, data);
|
BS_SUBMIT_GET_SQE(sqe, data);
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
|
|||||||
int res = heap->post_delete(op->oid, &modified_block);
|
int res = heap->post_delete(op->oid, &modified_block);
|
||||||
assert(res == 0);
|
assert(res == 0);
|
||||||
prepare_meta_block_write(op, modified_block);
|
prepare_meta_block_write(op, modified_block);
|
||||||
PRIV(op)->pending_ops++;
|
|
||||||
PRIV(op)->op_state = 5;
|
PRIV(op)->op_state = 5;
|
||||||
write_iodepth++;
|
write_iodepth++;
|
||||||
}
|
}
|
||||||
@@ -142,7 +141,7 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
|
|||||||
io_uring_prep_writev(
|
io_uring_prep_writev(
|
||||||
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + loc + op->offset - stripe_offset
|
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + loc + op->offset - stripe_offset
|
||||||
);
|
);
|
||||||
PRIV(op)->pending_ops = 1;
|
PRIV(op)->pending_ops++;
|
||||||
unsynced_big_write_count++;
|
unsynced_big_write_count++;
|
||||||
PRIV(op)->op_state = 1;
|
PRIV(op)->op_state = 1;
|
||||||
write_iodepth++;
|
write_iodepth++;
|
||||||
|
|||||||
Reference in New Issue
Block a user