<< "length=" << length << ", "
<< "flush=" << flush_entry << ", tid=" << tid << dendl;
- Context *on_safe = new C_IOEventSafe(this, tid);
+ Context *on_safe = create_async_context_callback(
+ m_image_ctx, new C_IOEventSafe(this, tid));
if (flush_entry) {
future.flush(on_safe);
} else {
op_finish_future = m_journaler->append(m_tag_tid, bl);
}
- op_finish_future.flush(new C_OpEventSafe(this, op_tid, op_start_future,
- op_finish_future));
+ op_finish_future.flush(create_async_context_callback(
+ m_image_ctx, new C_OpEventSafe(this, op_tid, op_start_future,
+ op_finish_future)));
}
template <typename I>
}
if (future.is_valid()) {
- future.flush(NULL);
+ future.flush(nullptr);
}
}
// commit journal event followed by IO event (standard)
on_journal_safe1->complete(0);
+ ictx->op_work_queue->drain();
expect_future_committed(mock_journaler);
mock_journal.commit_io_event(1U, 0);
C_SaferCond event_ctx;
mock_journal.wait_event(2U, &event_ctx);
on_journal_safe2->complete(0);
+ ictx->op_work_queue->drain();
ASSERT_EQ(0, event_ctx.wait());
}
// failed IO remains uncommitted in journal
on_journal_safe->complete(0);
+ ictx->op_work_queue->drain();
mock_journal.commit_io_event(1U, -EINVAL);
}