From: Danny Al-Gaaf Date: Wed, 22 Oct 2014 08:26:19 +0000 (+0200) Subject: mon/OSDMonitor.cc: reduce scope of variable X-Git-Tag: v0.88~22^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=935edd754a08a478ff940ae7106757ad125a6f40;p=ceph.git mon/OSDMonitor.cc: reduce scope of variable Signed-off-by: Danny Al-Gaaf --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f34a7e903a6..27ea9bbb3b2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -457,7 +457,6 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str, const PGMap &pgm = mon->pgmon()->pg_map; vector 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::const_iterator p = pgm.pg_stat.begin();