]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: use int32_t, not int
authorSage Weil <sage@redhat.com>
Fri, 19 May 2017 20:38:38 +0000 (16:38 -0400)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:49 +0000 (13:02 -0400)
These are encoded! Be explicit.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.h

index 9009362c0d621b8c426db611a4fb1ecd801b78f6..aa920347ef3c83271ecea1c3f802647cc3c2296a 100644 (file)
@@ -44,15 +44,15 @@ public:
   // aggregate state, populated by PGMap child
   int64_t num_pg = 0, num_osd = 0;
   int64_t num_pg_active = 0;
-  mempool::pgmap::unordered_map<int,pool_stat_t> pg_pool_sum;
+  mempool::pgmap::unordered_map<int32_t,pool_stat_t> pg_pool_sum;
   mempool::pgmap::map<int64_t,int64_t> num_pg_by_pool;
   pool_stat_t pg_sum;
   osd_stat_t osd_sum;
-  mempool::pgmap::unordered_map<int,int> num_pg_by_state;
+  mempool::pgmap::unordered_map<int32_t,int32_t> num_pg_by_state;
   struct pg_count {
-    int acting = 0;
-    int up = 0;
-    int primary = 0;
+    int32_t acting = 0;
+    int32_t up = 0;
+    int32_t primary = 0;
     void encode(bufferlist& bl) const {
       ::encode(acting, bl);
       ::encode(up, bl);
@@ -64,10 +64,7 @@ public:
       ::decode(primary, p);
     }
   };
-  mempool::pgmap::unordered_map<int,pg_count> num_pg_by_osd;
-
-  void print_summary(Formatter *f, ostream *out) const;
-  void print_oneline_summary(Formatter *f, ostream *out) const;
+  mempool::pgmap::unordered_map<int32_t,pg_count> num_pg_by_osd;
 
   // recent deltas, and summation
   /**
@@ -93,6 +90,9 @@ public:
   utime_t stamp_delta;
 
 
+  void print_summary(Formatter *f, ostream *out) const;
+  void print_oneline_summary(Formatter *f, ostream *out) const;
+
   void recovery_summary(Formatter *f, list<string> *psl,
                         const pool_stat_t& delta_sum) const;
   void overall_recovery_summary(Formatter *f, list<string> *psl) const;