From: huanwen ren Date: Fri, 29 Jul 2016 03:31:03 +0000 (+0800) Subject: mds/MDBalancer: some types of definitions are cleanup X-Git-Tag: ses5-milestone5~216^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c51349ba77fbc101108f39e8cc2ab6c199b23e7;p=ceph.git mds/MDBalancer: some types of definitions are cleanup Signed-off-by: huanwen ren --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 86e38f34189f..dcca7956069c 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -458,7 +458,7 @@ void MDBalancer::prep_rebalance(int beat) << dendl; } - double total_load = 0; + double total_load = 0.0; multimap load_map; for (mds_rank_t i=mds_rank_t(0); i < mds_rank_t(cluster_size); i++) { map::value_type val(i, mds_load_t(ceph_clock_now(g_ceph_context))); @@ -655,7 +655,7 @@ void MDBalancer::try_rebalance() //<< " .. " << (*it).second << " * " << load_fac << " -> " << amount << dendl;//" .. fudge is " << fudge << dendl; - double have = 0; + double have = 0.0; show_imports(); @@ -1007,7 +1007,7 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amoun dir->pop_spread.hit(now, mds->mdcache->decayrate, who); } - double rd_adj = 0; + double rd_adj = 0.0; if (type == META_POP_IRD && dir->last_popularity_sample < last_sample) { double dir_pop = dir->pop_auth_subtree.get(type).get(now, mds->mdcache->decayrate); // hmm?? @@ -1059,7 +1059,7 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, int who, double amoun bool hit_subtree = dir->is_auth(); // current auth subtree (if any) bool hit_subtree_nested = dir->is_auth(); // all nested auth subtrees - while (1) { + while (true) { dir->pop_nested.get(type).hit(now, amount); if (rd_adj != 0.0) dir->pop_nested.get(META_POP_IRD).adjust(now, mds->mdcache->decayrate, rd_adj); diff --git a/src/mds/MDBalancer.h b/src/mds/MDBalancer.h index 68546dbd9265..81b00b5e79ed 100644 --- a/src/mds/MDBalancer.h +++ b/src/mds/MDBalancer.h @@ -55,7 +55,7 @@ class MDBalancer { // per-epoch scatter/gathered info map mds_load; - map mds_meta_load; + map mds_meta_load; map > mds_import_map; // per-epoch state