crimson/os/seastore: rename ool_placement_hint_t

To placement_hint_t as the hint is not limited to ool extents.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin Cheng 2021-10-08 10:24:26 +08:00
parent e2b05287d5
commit 0f6a1571b8
3 changed files with 9 additions and 8 deletions

View File

@ -328,7 +328,7 @@ public:
device_type_t backend_type = device_type_t::NONE;
/// hint for allocators
ool_placement_hint_t hint;
placement_hint_t hint = placement_hint_t::NUM_HINTS;
bool is_inline() const {
return poffset.is_relative();

View File

@ -252,7 +252,7 @@ public:
Journal& journal,
Cache& cache);
Writer &get_writer(ool_placement_hint_t hint) {
Writer &get_writer(placement_hint_t hint) {
return writers[std::rand() % writers.size()];
}
@ -307,9 +307,10 @@ public:
Transaction& t,
extent_types_t type,
segment_off_t length,
ool_placement_hint_t hint = ool_placement_hint_t::NONE) {
placement_hint_t hint = placement_hint_t::NONE) {
// only logical extents should fall in this path
assert(is_logical_type(type));
assert(hint < placement_hint_t::NUM_HINTS);
auto dtype = get_allocator_type(hint);
CachedExtentRef extent;
// for extents that would be stored in NVDIMM/PMEM, no delayed
@ -332,8 +333,8 @@ public:
TCachedExtentRef<T> alloc_new_extent(
Transaction& t,
segment_off_t length,
ool_placement_hint_t hint = ool_placement_hint_t::NONE)
{
placement_hint_t hint = placement_hint_t::NONE) {
assert(hint < placement_hint_t::NUM_HINTS);
auto dtype = get_allocator_type(hint);
TCachedExtentRef<T> extent;
if (need_delayed_allocation(dtype)) {
@ -413,7 +414,7 @@ public:
}
private:
device_type_t get_allocator_type(ool_placement_hint_t hint) {
device_type_t get_allocator_type(placement_hint_t hint) {
return device_type_t::SEGMENTED;
}
@ -423,7 +424,7 @@ private:
ExtentAllocatorRef& get_allocator(
device_type_t type,
ool_placement_hint_t hint) {
placement_hint_t hint) {
auto& devices = allocators[type];
return devices[std::rand() % devices.size()];
}

View File

@ -244,7 +244,7 @@ using objaddr_t = uint32_t;
constexpr objaddr_t OBJ_ADDR_MAX = std::numeric_limits<objaddr_t>::max();
constexpr objaddr_t OBJ_ADDR_NULL = OBJ_ADDR_MAX - 1;
enum class ool_placement_hint_t {
enum class placement_hint_t {
NONE, /// Denotes empty hint
NUM_HINTS /// Constant for number of hints
};