From: Greg Farnum Date: Thu, 11 Mar 2021 07:58:19 +0000 (+0000) Subject: osd: check for is_stretch_pool() in stretch_set_can_peer() X-Git-Tag: v17.1.0~2614^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9185b0c437987b3d8cf3467ccaff22c8e422fe1;p=ceph.git osd: check for is_stretch_pool() in stretch_set_can_peer() This makes it easy and cheap to call from non-stretch contexts. Signed-off-by: Greg Farnum --- diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 82bc693dfe6c..07bdf025a45f 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -2239,6 +2239,7 @@ void pg_pool_t::decode(ceph::buffer::list::const_iterator& bl) bool pg_pool_t::stretch_set_can_peer(const set& want, const OSDMap& osdmap, std::ostream * out) const { + if (!is_stretch_pool()) return true; const uint32_t barrier_id = peering_crush_bucket_barrier; const uint32_t barrier_count = peering_crush_bucket_count; set ancestors; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 31195adae84e..c0fe8f781c21 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1521,6 +1521,7 @@ public: std::ostream *out) const; bool stretch_set_can_peer(const vector& want, const OSDMap& osdmap, std::ostream *out) const { + if (!is_stretch_pool()) return true; set swant; for (auto i : want) swant.insert(i); return stretch_set_can_peer(swant, osdmap, out);