]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: fix match_stage_t related compile issue
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 03:52:00 +0000 (11:52 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 15 Dec 2020 03:52:00 +0000 (11:52 +0800)
Change the type to int8_t for potential negative value when
substantiating the templates.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h
src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage_types.h

index e7e9f33449f9ae8b6505c6f073a3cd3578f6768e..574b989ab4314b255306b5dce58dbffbce639ff9 100644 (file)
@@ -14,14 +14,14 @@ namespace crimson::os::seastore::onode {
 #ifdef UNIT_TESTS_BUILT
 enum class InsertType { BEGIN, LAST, MID };
 struct split_expectation_t {
-  uint8_t split_stage;
-  uint8_t insert_stage;
+  match_stage_t split_stage;
+  match_stage_t insert_stage;
   bool is_insert_left;
   InsertType insert_type;
 };
 struct last_split_info_t {
   search_position_t split_pos;
-  uint8_t insert_stage;
+  match_stage_t insert_stage;
   bool is_insert_left;
   InsertType insert_type;
   bool match(const split_expectation_t& e) const {
index 60a0fbec72f462b7e11aa94c0c57a943643e7678..715b59de9eed9196263cbfaf3856774d4baecab8 100644 (file)
 
 namespace crimson::os::seastore::onode {
 
-using match_stage_t = uint8_t;
-constexpr match_stage_t STAGE_LEFT = 2u;   // shard/pool/crush
-constexpr match_stage_t STAGE_STRING = 1u; // nspace/oid
-constexpr match_stage_t STAGE_RIGHT = 0u;  // snap/gen
+using match_stage_t = int8_t;
+constexpr match_stage_t STAGE_LEFT = 2;   // shard/pool/crush
+constexpr match_stage_t STAGE_STRING = 1; // nspace/oid
+constexpr match_stage_t STAGE_RIGHT = 0;  // snap/gen
 constexpr auto STAGE_TOP = STAGE_LEFT;
 constexpr auto STAGE_BOTTOM = STAGE_RIGHT;
 constexpr bool is_valid_stage(match_stage_t stage) {