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);
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 ... -- {}",
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 ... -- {}",
}
void invalidate_hints() {
- user_hint = placement_hint_t::NUM_HINTS;
+ user_hint = PLACEMENT_HINT_NULL;
reclaim_generation = NULL_GENERATION;
}
{
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!";
}
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 {