]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/cache: drop extents on close()
authorSamuel Just <sjust@redhat.com>
Mon, 15 Jun 2020 20:29:46 +0000 (13:29 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 19 Jun 2020 19:59:26 +0000 (12:59 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cache.h

index a977db30db78c669f0ada486b03d433939712864..e5ab31c204cc384fb757a2b2fbaff88802dabbf5 100644 (file)
@@ -19,13 +19,6 @@ namespace crimson::os::seastore {
 
 Cache::~Cache()
 {
-  retire_extent(root);
-  root.reset();
-  for (auto i = dirty.begin(); i != dirty.end(); ) {
-    auto ptr = &*i;
-    dirty.erase(i++);
-    intrusive_ptr_release(ptr);
-  }
   for (auto &i: extents) {
     logger().error("~Cache: extent {} still alive", i);
   }
@@ -188,6 +181,13 @@ Cache::mkfs_ertr::future<> Cache::mkfs(Transaction &t)
 
 Cache::close_ertr::future<> Cache::close()
 {
+  retire_extent(root);
+  root.reset();
+  for (auto i = dirty.begin(); i != dirty.end(); ) {
+    auto ptr = &*i;
+    dirty.erase(i++);
+    intrusive_ptr_release(ptr);
+  }
   return close_ertr::now();
 }
 
index 7fa91a307b0bd9d2f221790d7637ed91f2a59429..e3495961b1a38735f0be08e56046d1368a84e56e 100644 (file)
@@ -338,7 +338,7 @@ public:
   /**
    * close
    *
-   * TODO: currently a noop -- probably should be used to flush dirty blocks
+   * TODO: should flush dirty blocks
    */
   using close_ertr = crimson::errorator<
     crimson::ct_error::input_output_error>;