From: xuxuehan Date: Thu, 25 May 2023 03:02:29 +0000 (+0800) Subject: crimson/os/seastore/transaction_manager: remove extents for physical lba mappings... X-Git-Tag: v19.0.0~699^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6bfd9455daa4ea5f0c86d0a931b808c5c60b3f5;p=ceph.git crimson/os/seastore/transaction_manager: remove extents for physical lba mappings if necessary when removing indirect lba mappings Signed-off-by: xuxuehan --- diff --git a/src/crimson/os/seastore/transaction_manager.cc b/src/crimson/os/seastore/transaction_manager.cc index a66cc7c11151..a829358b1fed 100644 --- a/src/crimson/os/seastore/transaction_manager.cc +++ b/src/crimson/os/seastore/transaction_manager.cc @@ -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; + }); }); }