From: Brad Hubbard Date: Wed, 17 Apr 2019 06:13:27 +0000 (+1000) Subject: osd/OSDMap: Replace get_out_osds with get_out_existing_osds X-Git-Tag: v15.1.0~2891^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adfb6a595363e2c085c6eac3001fcaa2dce007aa;p=ceph-ci.git osd/OSDMap: Replace get_out_osds with get_out_existing_osds Fixes: http://tracker.ceph.com/issues/39154 Signed-off-by: Brad Hubbard --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ecbb5cd2711..5d0d945f8d1 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -10446,7 +10446,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, (idvec[0] == "any" || idvec[0] == "all" || idvec[0] == "*")) { if (prefix == "osd in") { // touch out osds only - osdmap.get_out_osds(osds); + osdmap.get_out_existing_osds(osds); } else { osdmap.get_all_osds(osds); } diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index efb2b9b6d59..8cf8a9821ef 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1408,10 +1408,10 @@ void OSDMap::get_up_osds(set& ls) const } } -void OSDMap::get_out_osds(set& ls) const +void OSDMap::get_out_existing_osds(set& ls) const { for (int i = 0; i < max_osd; i++) { - if (is_out(i)) + if (exists(i) && get_weight(i) == CEPH_OSD_OUT) ls.insert(i); } } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 46081422e9b..50089cee46f 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -713,7 +713,7 @@ public: void get_all_osds(std::set& ls) const; void get_up_osds(std::set& ls) const; - void get_out_osds(std::set& ls) const; + void get_out_existing_osds(std::set& ls) const; unsigned get_num_pg_temp() const { return pg_temp->size(); }