]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor.cc: reduce scope of variable
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 22 Oct 2014 08:26:19 +0000 (10:26 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sun, 26 Oct 2014 17:10:13 +0000 (18:10 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/OSDMonitor.cc

index f34a7e903a68baf715a4bd070a7166eea121bf52..27ea9bbb3b27c6dba1ec33c4f24b5bcb62c0e12f 100644 (file)
@@ -457,7 +457,6 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str,
 
   const PGMap &pgm = mon->pgmon()->pg_map;
   vector<int> pgs_by_osd(osdmap.get_max_osd());
-  unsigned num_pg_copies = 0;
 
   // Avoid putting a small number (or 0) in the denominator when calculating
   // average_util
@@ -465,6 +464,7 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str,
   if (by_pg) {
     // by pg mapping
     double weight_sum = 0.0;      // sum up the crush weights
+    unsigned num_pg_copies = 0;
     int num_osds = 0;
     for (ceph::unordered_map<pg_t,pg_stat_t>::const_iterator p =
           pgm.pg_stat.begin();