template <typename I>
void ImageFlushRequest<I>::send_request() {
I &image_ctx = this->m_image_ctx;
- if (m_flush_source == FLUSH_SOURCE_USER) {
- // flag cache for writeback mode if configured
- image_ctx.user_flushed();
- }
bool journaling = false;
{
}
}
+ // ensure all object dispatch layers have flushed
+ auto object_dispatch_spec = ObjectDispatchSpec::create_flush(
+ &image_ctx, OBJECT_DISPATCH_LAYER_NONE, m_flush_source, this->m_trace, ctx);
+ ctx = new FunctionContext([object_dispatch_spec](int r) {
+ object_dispatch_spec->send(0);
+ });
+
// ensure all in-flight IOs are settled if non-user flush request
image_ctx.flush_async_operations(ctx);
aio_comp->start_op(true);
}));
}
- void expect_user_flushed(MockImageCtx &mock_image_ctx) {
- EXPECT_CALL(mock_image_ctx, user_flushed());
- }
-
void expect_flush(MockImageCtx &mock_image_ctx, int r) {
EXPECT_CALL(mock_image_ctx, flush_cache(_))
.WillOnce(CompleteContext(r, mock_image_ctx.image_ctx->op_work_queue));
mock_image_ctx.journal = &mock_journal;
InSequence seq;
- expect_user_flushed(mock_image_ctx);
expect_is_journal_appending(mock_journal, false);
expect_flush_async_operations(mock_image_ctx, 0);
+ expect_object_request_send(mock_image_ctx, 0);
expect_flush(mock_image_ctx, 0);
C_SaferCond aio_comp_ctx;