]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/transaction_manager: remove extents for physical lba mappings...
authorxuxuehan <xuxuehan@qianxin.com>
Thu, 25 May 2023 03:02:29 +0000 (11:02 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Thu, 10 Aug 2023 05:14:22 +0000 (13:14 +0800)
when removing indirect lba mappings

Signed-off-by: xuxuehan <xuxuehan@qianxin.com>
src/crimson/os/seastore/transaction_manager.cc

index a66cc7c11151061639dcfbca7e971a1c22c0df44..a829358b1fed41c48b3ca7747a5ab59633dbbb05 100644 (file)
@@ -237,21 +237,18 @@ TransactionManager::ref_ret TransactionManager::dec_ref(
   ).si_then([this, FNAME, offset, &t](auto result) -> ref_ret {
     DEBUGT("extent refcount is decremented to {} -- {}~{}, {}",
            t, result.refcount, offset, result.length, result.addr);
-    if (result.refcount == 0 &&
-        (result.addr.is_paddr() &&
-         !result.addr.get_paddr().is_zero())) {
-      return cache->retire_extent_addr(
-       t, result.addr.get_paddr(), result.length
-      ).si_then([] {
-       return ref_ret(
-         interruptible::ready_future_marker{},
-         0);
-      });
-    } else {
-      return ref_ret(
-       interruptible::ready_future_marker{},
-       result.refcount);
+    auto fut = ref_iertr::now();
+    if (result.refcount == 0) {
+      if (result.addr.is_paddr() &&
+          !result.addr.get_paddr().is_zero()) {
+        fut = cache->retire_extent_addr(
+          t, result.addr.get_paddr(), result.length);
+      }
     }
+
+    return fut.si_then([result=std::move(result)] {
+      return result.refcount;
+    });
   });
 }