From 4f8d2871de8576a1137a82893055d103b4065b14 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Tue, 15 Dec 2020 11:52:00 +0800 Subject: [PATCH] crimson/onode-staged-tree: fix match_stage_t related compile issue Change the type to int8_t for potential negative value when substantiating the templates. Signed-off-by: Yingxin Cheng --- .../os/seastore/onode_manager/staged-fltree/node_impl.h | 6 +++--- .../onode_manager/staged-fltree/stages/stage_types.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h index e7e9f33449f9a..574b989ab4314 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_impl.h @@ -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 { diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage_types.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage_types.h index 60a0fbec72f46..715b59de9eed9 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage_types.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage_types.h @@ -13,10 +13,10 @@ 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) { -- 2.39.5