From 935edd754a08a478ff940ae7106757ad125a6f40 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 22 Oct 2014 10:26:19 +0200 Subject: [PATCH] mon/OSDMonitor.cc: reduce scope of variable Signed-off-by: Danny Al-Gaaf --- src/mon/OSDMonitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f34a7e903a68b..27ea9bbb3b27c 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(); -- 2.39.5