]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/.../lba_manager: replace unused incref_extent with update_mapping_refcount
authorSamuel Just <sjust@redhat.com>
Tue, 30 Sep 2025 21:02:30 +0000 (21:02 +0000)
committerSamuel Just <sjust@redhat.com>
Mon, 5 Jan 2026 21:14:58 +0000 (13:14 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/lba/btree_lba_manager.h
src/crimson/os/seastore/lba_manager.h

index 49044a9c1221734a57b6fe4f77c52d0278e7069a..cc2a6296537b0ed3df9e35c904c01e20c4284dc4 100644 (file)
@@ -286,28 +286,19 @@ public:
     });
   }
 
-  ref_ret incref_extent(
+  base_iertr::future<LBACursorRef> update_mapping_refcount(
     Transaction &t,
-    laddr_t addr) final {
-    return update_refcount(t, addr, 1
-    ).si_then([](auto res) {
-      return ref_update_result_t(std::move(res), std::nullopt);
-    });
-  }
-
-  ref_ret incref_extent(
-    Transaction &t,
-    LBAMapping mapping) final {
-    assert(mapping.is_viewable());
-    return seastar::do_with(
-      std::move(mapping),
-      [&t, this](auto &mapping) {
-      auto &cursor = mapping.get_effective_cursor();
-      return update_refcount(t, &cursor, 1
-      ).si_then([](auto res) {
-       return ref_update_result_t(std::move(res), std::nullopt);
-      });
-    });
+    LBACursorRef cursor,
+    int delta) final {
+    auto result = co_await update_refcount(t, cursor.get(), delta
+    ).handle_error_interruptible(
+      base_iertr::pass_further{},
+      /* ENOENT in particular should be impossible */
+      crimson::ct_error::assert_all{
+       "Invalid enoent in BtreeLBAManager::incref_extent"
+      }
+    );
+    co_return result.mapping.direct_cursor;
   }
 
   remap_ret remap_mappings(
index d51b30678e40bae696c082f9af581ed84692ae63..be9cd2a34ab94b115234688869b0f2359ce85235 100644 (file)
@@ -219,16 +219,19 @@ public:
     LBAMapping mapping) = 0;
 
   /**
-   * Increments ref count on extent
-   *
-   * @return returns resulting refcount
+   * Update ref count on mapping
    */
-  virtual ref_ret incref_extent(
+  virtual base_iertr::future<LBACursorRef> update_mapping_refcount(
     Transaction &t,
-    laddr_t addr) = 0;
-  virtual ref_ret incref_extent(
+    LBACursorRef cursor,
+    int delta) = 0;
+  ref_iertr::future<> update_mapping_refcount(
     Transaction &t,
-    LBAMapping mapping) = 0;
+    laddr_t addr,
+    int delta) {
+    auto cursor = co_await get_cursor(t, addr);
+    co_await update_mapping_refcount(t, cursor, delta);
+  }
 
   struct remap_entry_t {
     extent_len_t offset;