From d483557c560fdc178c323baf1eeafc7a962b7432 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Thu, 27 Jan 2022 14:33:46 +0800 Subject: [PATCH] crimson/os/seastore: drop the unnecessary backend_type in every cached extent Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/cache.cc | 6 +++++- src/crimson/os/seastore/cached_extent.h | 3 --- src/crimson/os/seastore/extent_placement_manager.cc | 1 - src/crimson/os/seastore/extent_placement_manager.h | 4 +--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/crimson/os/seastore/cache.cc b/src/crimson/os/seastore/cache.cc index 692cb0e5859..fd07e98bc67 100644 --- a/src/crimson/os/seastore/cache.cc +++ b/src/crimson/os/seastore/cache.cc @@ -1017,13 +1017,17 @@ record_t Cache::prepare_record(Transaction &t) i->get_type()).increment(i->get_length()); retire_stat.increment(i->get_length()); commit_retire_extent(t, i); - if (i->backend_type == device_type_t::RANDOM_BLOCK) { + // FIXME: whether the extent belongs to RBM should be available through its + // device-id from its paddr after RBM is properly integrated. + /* + if (i belongs to RBM) { paddr_t paddr = i->get_paddr(); rbm_alloc_delta_t delta; delta.op = rbm_alloc_delta_t::op_types_t::CLEAR; delta.alloc_blk_ranges.push_back(std::make_pair(paddr, i->get_length())); t.add_rbm_alloc_info_blocks(delta); } + */ } record.extents.reserve(t.inline_block_list.size()); diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 906a7272eb5..e15abc38ca7 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -335,9 +335,6 @@ public: virtual ~CachedExtent(); - /// type of the backend device that will hold this extent - device_type_t backend_type = device_type_t::NONE; - /// hint for allocators placement_hint_t hint = placement_hint_t::NUM_HINTS; diff --git a/src/crimson/os/seastore/extent_placement_manager.cc b/src/crimson/os/seastore/extent_placement_manager.cc index 0be43a23d69..498bfdf570a 100644 --- a/src/crimson/os/seastore/extent_placement_manager.cc +++ b/src/crimson/os/seastore/extent_placement_manager.cc @@ -58,7 +58,6 @@ SegmentedAllocator::Writer::finish_write( lextent->get_paddr(), ool_extent.get_ool_paddr() ).si_then([&ool_extent, &t, &lextent, this, FNAME] { - lextent->backend_type = device_type_t::NONE; lextent->hint = {}; TRACET("mark extent as ool at {} -- {}", t, ool_extent.get_ool_paddr(), *lextent); t.mark_delayed_extent_ool(lextent, ool_extent.get_ool_paddr()); diff --git a/src/crimson/os/seastore/extent_placement_manager.h b/src/crimson/os/seastore/extent_placement_manager.h index 50c2a081523..764844113a3 100644 --- a/src/crimson/os/seastore/extent_placement_manager.h +++ b/src/crimson/os/seastore/extent_placement_manager.h @@ -312,7 +312,6 @@ public: can_delay_allocation(dtype)); CachedExtentRef extent = cache.alloc_new_extent_by_type( t, type, length, delay); - extent->backend_type = dtype; extent->hint = hint; return extent; } @@ -333,7 +332,6 @@ public: can_delay_allocation(dtype)); TCachedExtentRef extent = cache.alloc_new_extent( t, length, delay); - extent->backend_type = dtype; extent->hint = hint; return extent; } @@ -363,7 +361,7 @@ public: } // For now, just do ool allocation for any delayed extent auto& allocator_ptr = get_allocator( - extent->backend_type, extent->hint + get_allocator_type(extent->hint), extent->hint ); alloc_map[allocator_ptr.get()].emplace_back(extent); num_ool_extents++;