]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: drop unused nocreating flag for stat_pg_{add,sub}
authorSage Weil <sage@redhat.com>
Thu, 10 Mar 2016 18:15:43 +0000 (13:15 -0500)
committerSage Weil <sage@redhat.com>
Mon, 14 Mar 2016 15:29:21 +0000 (11:29 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc
src/mon/PGMap.h

index b81db7cd67606b1b91d111ede9d93fa87b78cc9d..81162012b0e730405598e05331b9216a64236f32 100644 (file)
@@ -459,7 +459,7 @@ void PGMap::remove_osd(int osd)
   }
 }
 
-void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
+void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s,
                         bool sameosds)
 {
   pg_pool_sum[pgid.pool()].add(s);
@@ -468,12 +468,10 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
   num_pg++;
   num_pg_by_state[s.state]++;
 
-  if (!nocreating) {
-    if (s.state & PG_STATE_CREATING) {
-      creating_pgs.insert(pgid);
-      if (s.acting_primary >= 0) {
-       creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid);
-      }
+  if (s.state & PG_STATE_CREATING) {
+    creating_pgs.insert(pgid);
+    if (s.acting_primary >= 0) {
+      creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid);
     }
   }
 
@@ -492,7 +490,7 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
     pg_by_osd[*p].insert(pgid);
 }
 
-void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
+void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s,
                         bool sameosds)
 {
   pool_stat_t& ps = pg_pool_sum[pgid.pool()];
@@ -507,17 +505,15 @@ void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
   if (end == 0)
     num_pg_by_state.erase(s.state);
 
-  if (!nocreating) {
-    if (s.state & PG_STATE_CREATING) {
-      creating_pgs.erase(pgid);
-      if (s.acting_primary >= 0) {
-       map<epoch_t,set<pg_t> >& r = creating_pgs_by_osd_epoch[s.acting_primary];
-       r[s.mapping_epoch].erase(pgid);
-       if (r[s.mapping_epoch].empty())
-         r.erase(s.mapping_epoch);
-       if (r.empty())
-         creating_pgs_by_osd_epoch.erase(s.acting_primary);
-      }
+  if (s.state & PG_STATE_CREATING) {
+    creating_pgs.erase(pgid);
+    if (s.acting_primary >= 0) {
+      map<epoch_t,set<pg_t> >& r = creating_pgs_by_osd_epoch[s.acting_primary];
+      r[s.mapping_epoch].erase(pgid);
+      if (r[s.mapping_epoch].empty())
+       r.erase(s.mapping_epoch);
+      if (r.empty())
+       creating_pgs_by_osd_epoch.erase(s.acting_primary);
     }
   }
 
@@ -559,9 +555,9 @@ void PGMap::stat_pg_update(const pg_t pgid, pg_stat_t& s,
     s.up == n.up &&
     s.blocked_by == n.blocked_by;
 
-  stat_pg_sub(pgid, s, false, sameosds);
+  stat_pg_sub(pgid, s, sameosds);
   s = n;
-  stat_pg_add(pgid, n, false, sameosds);
+  stat_pg_add(pgid, n, sameosds);
 }
 
 void PGMap::stat_osd_add(const osd_stat_t &s)
index 8c2b3cadea2dff106eb0fb2cb6cb1dcf2245db81..335c1207bc9fc5c8bb9aa1869281817184dceb31 100644 (file)
@@ -258,9 +258,9 @@ public:
   void redo_full_sets();
   void register_nearfull_status(int osd, const osd_stat_t& s);
   void calc_stats();
-  void stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating=false,
+  void stat_pg_add(const pg_t &pgid, const pg_stat_t &s,
                   bool sameosds=false);
-  void stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating=false,
+  void stat_pg_sub(const pg_t &pgid, const pg_stat_t &s,
                   bool sameosds=false);
   void stat_pg_update(const pg_t pgid, pg_stat_t &prev, bufferlist::iterator& blp);
   void stat_osd_add(const osd_stat_t &s);