From: Yingxin Cheng Date: Thu, 29 Apr 2021 01:59:16 +0000 (+0800) Subject: crimson/onode-staged-tree: declare and use max key indexes X-Git-Tag: v17.1.0~2016^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c9b885efefab309db17e95f4469a7ab3c45111e9;p=ceph-ci.git crimson/onode-staged-tree: declare and use max key indexes Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h index 47f6c9d7edf..425c8cd5952 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/key_layout.h @@ -25,6 +25,12 @@ static_assert(sizeof(crush_hash_t) == sizeof(ghobject_t().hobj.get_hash())); static_assert(sizeof(snap_t) == sizeof(ghobject_t().hobj.snap.val)); static_assert(sizeof(gen_t) == sizeof(ghobject_t().generation)); +constexpr auto MAX_SHARD = std::numeric_limits::max(); +constexpr auto MAX_POOL = std::numeric_limits::max(); +constexpr auto MAX_CRUSH = std::numeric_limits::max(); +constexpr auto MAX_SNAP = std::numeric_limits::max(); +constexpr auto MAX_GEN = std::numeric_limits::max(); + class NodeExtentMutable; class key_view_t; class key_hobj_t; diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/tree_utils.h b/src/crimson/os/seastore/onode_manager/staged-fltree/tree_utils.h index 7d65b1a8cf9..016244ac383 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/tree_utils.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/tree_utils.h @@ -155,8 +155,8 @@ class KVPool { const std::pair& range1, const std::pair& range0) { ceph_assert(range2.first < range2.second); - ceph_assert(range2.second - 1 <= (index_t)std::numeric_limits::max()); - ceph_assert(range2.second - 1 <= std::numeric_limits::max()); + ceph_assert(range2.second - 1 <= MAX_SHARD); + ceph_assert(range2.second - 1 <= MAX_CRUSH); ceph_assert(range1.first < range1.second); ceph_assert(range1.second - 1 <= 9); ceph_assert(range0.first < range0.second);