]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cache: let root exist in the dirty list
authorSamuel Just <sjust@redhat.com>
Fri, 21 Aug 2020 05:12:05 +0000 (22:12 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 23 Sep 2020 22:13:51 +0000 (15:13 -0700)
Most handling remains special, but this way the dirty list we
work on will include root directly.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cache.cc

index e5b98c337efa8964ac049f0716d3c894ebf76d50..25d20be3fabb26255d75ae2cecbd4f91d927f544 100644 (file)
@@ -198,9 +198,12 @@ void Cache::complete_commit(
   paddr_t final_block_start)
 {
   if (t.root) {
+    remove_extent(root);
     root = t.root;
-    root->on_delta_write(final_block_start);
     root->state = CachedExtent::extent_state_t::DIRTY;
+    root->on_delta_write(final_block_start);
+    root->dirty_from = seq;
+    add_extent(root);
     logger().debug("complete_commit: new root {}", *t.root);
   }
 
@@ -242,8 +245,14 @@ void Cache::complete_commit(
 }
 
 void Cache::init() {
+  if (root) {
+    // initial creation will do mkfs followed by mount each of which calls init
+    remove_extent(root);
+    root = nullptr;
+  }
   root = new RootBlock();
   root->state = CachedExtent::extent_state_t::DIRTY;
+  add_extent(root);
 }
 
 Cache::mkfs_ertr::future<> Cache::mkfs(Transaction &t)