From: Samuel Just Date: Tue, 30 Sep 2025 21:02:30 +0000 (+0000) Subject: crimson/.../lba_manager: replace unused incref_extent with update_mapping_refcount X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c413b23af12c252b4f518e5e34b98e593adf3a86;p=ceph-ci.git crimson/.../lba_manager: replace unused incref_extent with update_mapping_refcount Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/lba/btree_lba_manager.h b/src/crimson/os/seastore/lba/btree_lba_manager.h index 49044a9c122..cc2a6296537 100644 --- a/src/crimson/os/seastore/lba/btree_lba_manager.h +++ b/src/crimson/os/seastore/lba/btree_lba_manager.h @@ -286,28 +286,19 @@ public: }); } - ref_ret incref_extent( + base_iertr::future 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( diff --git a/src/crimson/os/seastore/lba_manager.h b/src/crimson/os/seastore/lba_manager.h index d51b30678e4..be9cd2a34ab 100644 --- a/src/crimson/os/seastore/lba_manager.h +++ b/src/crimson/os/seastore/lba_manager.h @@ -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 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;