]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: use explicitly sized types for network and disk encoding 55741/head
authorXiubo Li <xiubli@redhat.com>
Thu, 16 Nov 2023 07:35:05 +0000 (15:35 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 26 Feb 2024 02:13:33 +0000 (10:13 +0800)
The size of 'unsigned' type maybe not different from different OSes.
And we should always use explicitly sized type.

Fixes: https://tracker.ceph.com/issues/63552
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit d01bd53da20e2c7952ae1a0943b21075b215d28b)

src/mds/Capability.h
src/mds/OpenFileTable.h
src/messages/MClientCaps.h
src/messages/MClientSession.h
src/messages/MMDSScrub.h
src/messages/MMDSScrubStats.h

index 3fd6d2ce6d4f0d5924d839099098bd618da68dab..ebc626a22949ae07d31cfb101f789d26f1ee2274 100644 (file)
@@ -381,7 +381,7 @@ private:
   ceph_seq_t mseq = 0;
 
   int suppress = 0;
-  unsigned state = 0;
+  uint32_t state = 0;
 
   int lock_cache_allowed = 0;
 };
index 1f91c202021f9ad8d3ee5c11a0c9459e48fe48d3..b18395213f56b5ad3dca81e429b9936c299e785f 100644 (file)
@@ -113,7 +113,7 @@ protected:
 
   version_t omap_version = 0;
 
-  unsigned omap_num_objs = 0;
+  uint32_t omap_num_objs = 0;
   std::vector<unsigned> omap_num_items;
 
   std::map<inodeno_t, OpenedAnchor> anchor_map;
index 77e8db1d0992bd201b693dab77e9ae2b531bbc24..ffbf02878298c6d81f2bb1d6a3cbc4a397bbf84f 100644 (file)
@@ -57,7 +57,7 @@ private:
   uint32_t caller_gid = 0;
 
   /* advisory CLIENT_CAPS_* flags to send to mds */
-  unsigned flags = 0;
+  uint32_t flags = 0;
 
   int      get_caps() const { return head.caps; }
   int      get_wanted() const { return head.wanted; }
index 7ce165870c3f889c35f62e9344698a2e5e1b8a7f..32ad6712d6ca7865dc9f374d9936167f1be8add9 100644 (file)
@@ -27,7 +27,7 @@ public:
   ceph_mds_session_head head;
   static constexpr unsigned SESSION_BLOCKLISTED = (1<<0);
 
-  unsigned flags = 0;
+  uint32_t flags = 0;
   std::map<std::string, std::string> metadata;
   feature_bitset_t supported_features;
   metric_spec_t metric_spec;
index a1bf2b54f5dd07a7e7ef016d97f1a92fe08cb608..7714b377608ee73bb35883e3b4b371cb34d0d882 100644 (file)
@@ -130,11 +130,11 @@ private:
   static constexpr unsigned FLAG_RECURSIVE     = 1<<2;
   static constexpr unsigned FLAG_REPAIR                = 1<<3;
 
-  int op;
+  int32_t op;
   inodeno_t ino;
   fragset_t frags;
   std::string tag;
   inodeno_t origin;
-  unsigned flags = 0;
+  uint32_t flags = 0;
 };
 #endif // CEPH_MMDSSCRUB_H
index c60981be5907a224ac07cb37b7cfefd5b67dc023..2cbb7f2f2116f9cc79e6ba1cc9145becffaff4d5 100644 (file)
@@ -68,7 +68,7 @@ protected:
   ~MMDSScrubStats() override {}
 
 private:
-  unsigned epoch;
+  uint32_t epoch;
   std::set<std::string> scrubbing_tags;
   bool update_scrubbing = false;
   bool aborting = false;