]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: copy blacklist in better way.
authorsongbaisen <song.baisen@zte.com.cn>
Mon, 14 Mar 2016 11:50:09 +0000 (19:50 +0800)
committerBoris Ranto <branto@redhat.com>
Fri, 6 May 2016 11:44:17 +0000 (13:44 +0200)
Signed-off-by: song baisen song.baisen@zte.com.cn
src/osd/OSDMap.cc

index 703514bc67c4610c8b4b8dd5bab5cd915f7f4edc..124a1ab2364a4a3d29bd53c79d0c4d582030fe50 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include "OSDMap.h"
-
+#include <algorithm>
 #include "common/config.h"
 #include "common/Formatter.h"
 #include "common/TextTable.h"
@@ -905,10 +905,7 @@ bool OSDMap::is_blacklisted(const entity_addr_t& a) const
 
 void OSDMap::get_blacklist(list<pair<entity_addr_t,utime_t> > *bl) const
 {
-  for (ceph::unordered_map<entity_addr_t,utime_t>::const_iterator it = blacklist.begin() ;
-                        it != blacklist.end(); ++it) {
-    bl->push_back(*it);
-  }
+   std::copy(blacklist.begin(), blacklist.end(), std::back_inserter(*bl));
 }
 
 void OSDMap::set_max_osd(int m)