]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/cache/pwl/ssd: set m_bytes_allocated_cap on recovery
authorIlya Dryomov <idryomov@gmail.com>
Thu, 13 May 2021 11:11:57 +0000 (13:11 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sat, 15 May 2021 16:48:22 +0000 (18:48 +0200)
Currently it's set only when a new cache is formatted.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/cache/pwl/ssd/WriteLog.cc

index 6d558d37f530fe790dc0438c71c3eea392036989..94eeae04f7c6e93700e431ad1e379bc80cc9a9be 100644 (file)
@@ -216,6 +216,9 @@ void WriteLog<I>::load_existing_entries(pwl::DeferredContexts &later) {
   this->m_first_valid_entry = pool_root.first_valid_entry;
   this->m_first_free_entry = pool_root.first_free_entry;
 
+  this->m_bytes_allocated_cap =
+      this->m_log_pool_size - DATA_RING_BUFFER_OFFSET;
+
   std::map<uint64_t, std::shared_ptr<SyncPointLogEntry>> sync_point_entries;
 
   std::map<uint64_t, bool> missing_sync_points;