From: Yingxin Cheng Date: Mon, 18 Jul 2022 03:23:20 +0000 (+0800) Subject: crimson/os/seastore: introduce PLACEMENT_HINT_NULL X-Git-Tag: v18.0.0~472^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5276707aeba07412c9ec8f4e1a52a4a2a020641b;p=ceph.git crimson/os/seastore: introduce PLACEMENT_HINT_NULL Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 54922cd02c7a4..d1c25a16098ba 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -96,7 +96,7 @@ Cache::retire_extent_ret Cache::retire_extent_addr( RetiredExtentPlaceholder>(length); ext->init(CachedExtent::extent_state_t::CLEAN, addr, - placement_hint_t::NUM_HINTS, + PLACEMENT_HINT_NULL, NULL_GENERATION); DEBUGT("retire {}~{} as placeholder, add extent -- {}", t, addr, length, *ext); diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 54a96c12b59aa..9d4e3528d108f 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -310,7 +310,7 @@ public: alloc_cache_buf(length)); ret->init(CachedExtent::extent_state_t::CLEAN_PENDING, offset, - placement_hint_t::NUM_HINTS, + PLACEMENT_HINT_NULL, NULL_GENERATION); SUBDEBUG(seastore_cache, "{} {}~{} is absent, add extent and reading ... -- {}", @@ -329,7 +329,7 @@ public: alloc_cache_buf(length)); ret->init(CachedExtent::extent_state_t::CLEAN_PENDING, offset, - placement_hint_t::NUM_HINTS, + PLACEMENT_HINT_NULL, NULL_GENERATION); SUBDEBUG(seastore_cache, "{} {}~{} is absent(placeholder), reading ... -- {}", diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 83f223f5d42e0..5054aea8f65aa 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -399,7 +399,7 @@ public: } void invalidate_hints() { - user_hint = placement_hint_t::NUM_HINTS; + user_hint = PLACEMENT_HINT_NULL; reclaim_generation = NULL_GENERATION; } diff --git a/src/crimson/os/seastore/seastore_types.cc b/src/crimson/os/seastore/seastore_types.cc index 7ad95e115160b..a9b0d1c5fd486 100644 --- a/src/crimson/os/seastore/seastore_types.cc +++ b/src/crimson/os/seastore/seastore_types.cc @@ -646,11 +646,13 @@ std::ostream& operator<<(std::ostream& out, placement_hint_t h) { switch (h) { case placement_hint_t::HOT: - return out << "HOT"; + return out << "Hint(HOT)"; case placement_hint_t::COLD: - return out << "COLD"; + return out << "Hint(COLD)"; case placement_hint_t::REWRITE: - return out << "REWRITE"; + return out << "Hint(REWRITE)"; + case PLACEMENT_HINT_NULL: + return out << "Hint(NULL)"; default: return out << "INVALID_PLACEMENT_HINT_TYPE!"; } diff --git a/src/crimson/os/seastore/seastore_types.h b/src/crimson/os/seastore/seastore_types.h index a49f2f989d513..a14ccaeb27776 100644 --- a/src/crimson/os/seastore/seastore_types.h +++ b/src/crimson/os/seastore/seastore_types.h @@ -764,9 +764,11 @@ enum class placement_hint_t { HOT = 0, // The default user hint that expects mutations or retirement COLD, // Expect no mutations and no retirement in the near future REWRITE, // Hint for the internal rewrites - NUM_HINTS // Constant for number of hints + NUM_HINTS // Constant for number of hints or as NULL }; +constexpr auto PLACEMENT_HINT_NULL = placement_hint_t::NUM_HINTS; + std::ostream& operator<<(std::ostream& out, placement_hint_t h); enum alignas(4) device_type_t : uint_fast8_t {