]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../transaction_manager: convert remove to use cursor interfaces
authorSamuel Just <sjust@redhat.com>
Thu, 2 Oct 2025 20:47:46 +0000 (13:47 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 28 Jan 2026 02:38:19 +0000 (18:38 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/transaction_manager.cc

index d68e14d98e288c371e89fbf802b180dc1eff80a2..6735569cd5f84a7355b0a2cfef51fe752b5ac069 100644 (file)
@@ -221,17 +221,22 @@ TransactionManager::ref_ret TransactionManager::remove(
 {
   LOG_PREFIX(TransactionManager::remove);
   DEBUGT("{} ...", t, *ref);
-  auto mapping = co_await lba_manager->get_mapping(t, *ref);
-  auto result = co_await lba_manager->remove_mapping(t, std::move(mapping));
-  assert(!result.direct_result);
-  auto &primary_result = result.result;
-  if (primary_result.refcount == 0) {
+  auto cursor = co_await lba_manager->get_cursor(t, *ref);
+  assert(cursor->is_direct());
+  extent_ref_count_t refcount = cursor->get_refcount();
+  auto laddr = cursor->get_laddr();
+  auto length = cursor->get_length();
+  assert(refcount > 0);
+  --refcount;
+  co_await lba_manager->update_mapping_refcount(
+    t, std::move(cursor), -1);
+  if (refcount == 0) {
     cache->retire_extent(t, ref);
   }
   DEBUGT("removed {}~0x{:x} refcount={} -- {}",
-        t, primary_result.addr, primary_result.length,
-        primary_result.refcount, *ref);
-  co_return primary_result.refcount;
+        t, laddr, length,
+        refcount, *ref);
+  co_return refcount;
 }
 
 TransactionManager::ref_ret TransactionManager::remove(