]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: drop the unnecessary backend_type in every cached extent
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 27 Jan 2022 06:33:46 +0000 (14:33 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 11 Feb 2022 01:26:22 +0000 (09:26 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h
src/crimson/os/seastore/extent_placement_manager.cc
src/crimson/os/seastore/extent_placement_manager.h

index 692cb0e585982274f88992b06695a0ec92a1881b..fd07e98bc67d195ffc0e5d4f191ef50824726257 100644 (file)
@@ -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());
index 906a7272eb5245f98bb5e8c93291b5540cd07553..e15abc38ca79779246d85c65f714575984a07c5a 100644 (file)
@@ -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;
 
index 0be43a23d69053e8e2bd3e03e8b3b8b20b18c02c..498bfdf570a09d235a0523e613487c9ad6de3903 100644 (file)
@@ -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());
index 50c2a08152364bc89bc0d9054a155b7cb3482b30..764844113a37de5732bf9ecb063ba30e3abadaa5 100644 (file)
@@ -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<T> extent = cache.alloc_new_extent<T>(
         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++;