]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/EPM: use DEVICE_ID_GLOBAL_MAX for devices 45574/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 12 Apr 2022 13:48:14 +0000 (21:48 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 12 Apr 2022 13:48:14 +0000 (21:48 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/extent_placement_manager.h
src/crimson/os/seastore/seastore_types.h

index 944232afe6709084829cffe5d5fc63ffe7694f42..d5b66ea42b6ce82be260fefa8374658ebba5d7b4 100644 (file)
@@ -86,7 +86,7 @@ private:
 class ExtentPlacementManager {
 public:
   ExtentPlacementManager() {
-    devices_by_id.resize(DEVICE_ID_MAX, nullptr);
+    devices_by_id.resize(DEVICE_ID_GLOBAL_MAX, nullptr);
   }
 
   void init_ool_writers(SegmentProvider &sp, SegmentSeqAllocator &ssa) {
@@ -214,7 +214,7 @@ public:
       });
     }).safe_then([this] {
       devices_by_id.clear();
-      devices_by_id.resize(DEVICE_ID_MAX, nullptr);
+      devices_by_id.resize(DEVICE_ID_GLOBAL_MAX, nullptr);
       primary_device = nullptr;
     });
   }
index d54add7c7c949176ca3bc727438a7d71343ede2c..a45760ad4750502d26171f426330bfccff2e7ad8 100644 (file)
@@ -62,8 +62,10 @@ constexpr uint16_t DEVICE_ID_LEN_BITS = 8;
 // segment ids without a device id encapsulated
 using device_segment_id_t = uint32_t;
 
-constexpr device_id_t DEVICE_ID_MAX = 
-  (std::numeric_limits<device_id_t>::max() >>
+constexpr device_id_t DEVICE_ID_GLOBAL_MAX =
+  std::numeric_limits<device_id_t>::max();
+constexpr device_id_t DEVICE_ID_MAX = // the max value regardless of addrs_type_t prefix
+  (DEVICE_ID_GLOBAL_MAX >>
    (std::numeric_limits<device_id_t>::digits - DEVICE_ID_LEN_BITS + 1));
 constexpr device_id_t DEVICE_ID_NULL = DEVICE_ID_MAX;
 constexpr device_id_t DEVICE_ID_RECORD_RELATIVE = DEVICE_ID_MAX - 1;