From df15d59dfb349413d864b38f62d1c7f41cad6525 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Wed, 23 Oct 2024 15:21:41 +0800 Subject: [PATCH] crimson/os/seastore/cache: cleanup, use the same method to create extents Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/cache.cc | 2 +- src/crimson/os/seastore/cache.h | 2 +- src/crimson/os/seastore/cached_extent.h | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 70fec7caca48a..0a1c2b576bb63 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -1826,7 +1826,7 @@ void Cache::init() remove_extent(root, nullptr); root = nullptr; } - root = new RootBlock(); + root = CachedExtent::make_cached_extent_ref(); root->init(CachedExtent::extent_state_t::CLEAN, P_ADDR_ROOT, PLACEMENT_HINT_NULL, diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index cd65d82fe5a85..e93e0f91a9b4f 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -1068,7 +1068,7 @@ public: // (relative/temp) paddr, so make extent directly ext = CachedExtent::make_cached_extent_ref(std::move(nbp)); } else { - ext = CachedExtent::make_placeholder_cached_extent_ref(remap_length); + ext = CachedExtent::make_cached_extent_ref(remap_length); } ext->init(CachedExtent::extent_state_t::EXIST_CLEAN, diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 8443c99b90a92..99bad9094bf75 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -816,9 +816,8 @@ protected: } template - static TCachedExtentRef make_placeholder_cached_extent_ref( - extent_len_t length) { - return new T(length); + static TCachedExtentRef make_cached_extent_ref() { + return new T(); } void reset_prior_instance() { -- 2.39.5