}
{
std::lock_guard locker(m_lock);
- ceph_assert(m_dirty_log_entries.size() == 0);
+ check_image_cache_state_clean();
m_wake_up_enabled = false;
m_cache_state->clean = true;
m_log_entries.clear();
return log_entry->can_retire();
}
+template <typename I>
+void AbstractWriteLog<I>::check_image_cache_state_clean() {
+ ceph_assert(m_deferred_ios.empty());
+ ceph_assert(m_ops_to_append.empty());;
+ ceph_assert(m_async_flush_ops == 0);
+ ceph_assert(m_async_append_ops == 0);
+ ceph_assert(m_dirty_log_entries.empty());
+ ceph_assert(m_ops_to_flush.empty());
+ ceph_assert(m_flush_ops_in_flight == 0);
+ ceph_assert(m_flush_bytes_in_flight == 0);
+ ceph_assert(m_bytes_dirty == 0);
+ ceph_assert(m_work_queue.empty());
+}
+
} // namespace pwl
} // namespace cache
} // namespace librbd
void pwl_init(Context *on_finish, pwl::DeferredContexts &later);
void update_image_cache_state(Context *on_finish);
+ void check_image_cache_state_clean();
void flush_dirty_entries(Context *on_finish);
bool can_flush_entry(const std::shared_ptr<pwl::GenericLogEntry> log_entry);