]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap: std::set version of get_blacklist
authorJohn Spray <john.spray@redhat.com>
Thu, 16 Feb 2017 17:20:48 +0000 (17:20 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 23 May 2017 09:22:15 +0000 (05:22 -0400)
Signed-off-by: John Spray <john.spray@redhat.com>
src/osd/OSDMap.cc
src/osd/OSDMap.h

index fbfcd5a5b4090132af6eff39af3d7671fd16ac7f..32aeb4870d89294c142c20e0f3858e4308f92f47 100644 (file)
@@ -1017,6 +1017,13 @@ void OSDMap::get_blacklist(list<pair<entity_addr_t,utime_t> > *bl) const
    std::copy(blacklist.begin(), blacklist.end(), std::back_inserter(*bl));
 }
 
+void OSDMap::get_blacklist(std::set<entity_addr_t> *bl) const
+{
+  for (const auto &i : blacklist) {
+    bl->insert(i.first);
+  }
+}
+
 void OSDMap::set_max_osd(int m)
 {
   int o = max_osd;
index 74f0b833a2e116ebe92e95f378140e2fa63bc891..5d1819df33275df7e23c1e981f4fd4feff32ceeb 100644 (file)
@@ -345,6 +345,7 @@ public:
 
   bool is_blacklisted(const entity_addr_t& a) const;
   void get_blacklist(list<pair<entity_addr_t,utime_t > > *bl) const;
+  void get_blacklist(std::set<entity_addr_t> *bl) const;
 
   string get_cluster_snapshot() const {
     if (cluster_snapshot_epoch == epoch)