]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDBalancer: some types of definitions are cleanup
authorhuanwen ren <ren.huanwen@zte.com.cn>
Fri, 29 Jul 2016 03:31:03 +0000 (11:31 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 3 Aug 2016 01:19:51 +0000 (09:19 +0800)
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mds/MDBalancer.cc
src/mds/MDBalancer.h

index 86e38f34189f0f4ad2e510d9116432e6587231de..dcca7956069c74ff1525f56b4073c034d8658ac1 100644 (file)
@@ -458,7 +458,7 @@ void MDBalancer::prep_rebalance(int beat)
              << dendl;
     }
 
-    double total_load = 0;
+    double total_load = 0.0;
     multimap<double,mds_rank_t> load_map;
     for (mds_rank_t i=mds_rank_t(0); i < mds_rank_t(cluster_size); i++) {
       map<mds_rank_t, mds_load_t>::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);
index 68546dbd926555e782437c73572332d9fa36d9b6..81b00b5e79ed699928a45bb369ca1b48c6a82ef7 100644 (file)
@@ -55,7 +55,7 @@ class MDBalancer {
 
   // per-epoch scatter/gathered info
   map<mds_rank_t, mds_load_t>  mds_load;
-  map<mds_rank_t, float>       mds_meta_load;
+  map<mds_rank_t, double>       mds_meta_load;
   map<mds_rank_t, map<mds_rank_t, float> > mds_import_map;
 
   // per-epoch state