template <typename I>
void AioImageFlush<I>::send_request() {
I &image_ctx = this->m_image_ctx;
+ image_ctx.user_flushed();
+
bool journaling = false;
{
RWLock::RLocker snap_locker(image_ctx.snap_lock);
ASSERT_EQ(0, aio_comp->wait_for_complete());
aio_comp->release();
+ {
+ // user flush requests are ignored when journaling + cache are enabled
+ RWLock::RLocker owner_lock(ictx->owner_lock);
+ ictx->flush();
+ }
+
// check the commit position updated
get_journal_commit_position(ictx, ¤t_tag, ¤t_entry);
ASSERT_EQ(initial_tag + 1, current_tag);
uint8_t protection_status, uint64_t flags));
MOCK_METHOD2(rm_snap, void(std::string in_snap_name, librados::snap_t id));
+ MOCK_METHOD0(user_flushed, void());
MOCK_METHOD1(flush, void(Context *));
MOCK_METHOD1(flush_async_operations, void(Context *));
MOCK_METHOD1(flush_copyup, void(Context *));
}));
}
+ 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(_))
.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(mock_image_ctx, 0);