From: Xiubo Li Date: Thu, 16 Nov 2023 07:35:05 +0000 (+0800) Subject: mds: use explicitly sized types for network and disk encoding X-Git-Tag: testing/wip-pdonnell-testing-20240430.123648-reef-debug~145^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc7bc819e743ba89ecf2434c587c0414799eceba;p=ceph-ci.git mds: use explicitly sized types for network and disk encoding 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 (cherry picked from commit d01bd53da20e2c7952ae1a0943b21075b215d28b) --- diff --git a/src/mds/Capability.h b/src/mds/Capability.h index 3fd6d2ce6d4..ebc626a2294 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -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; }; diff --git a/src/mds/OpenFileTable.h b/src/mds/OpenFileTable.h index 1f91c202021..b18395213f5 100644 --- a/src/mds/OpenFileTable.h +++ b/src/mds/OpenFileTable.h @@ -113,7 +113,7 @@ protected: version_t omap_version = 0; - unsigned omap_num_objs = 0; + uint32_t omap_num_objs = 0; std::vector omap_num_items; std::map anchor_map; diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index 9d343a4af6b..96b2cb7d8b8 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -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; std::vector fscrypt_auth; std::vector fscrypt_file; diff --git a/src/messages/MClientSession.h b/src/messages/MClientSession.h index 7ce165870c3..32ad6712d6c 100644 --- a/src/messages/MClientSession.h +++ b/src/messages/MClientSession.h @@ -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 metadata; feature_bitset_t supported_features; metric_spec_t metric_spec; diff --git a/src/messages/MMDSScrub.h b/src/messages/MMDSScrub.h index a1bf2b54f5d..7714b377608 100644 --- a/src/messages/MMDSScrub.h +++ b/src/messages/MMDSScrub.h @@ -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 diff --git a/src/messages/MMDSScrubStats.h b/src/messages/MMDSScrubStats.h index c60981be590..2cbb7f2f211 100644 --- a/src/messages/MMDSScrubStats.h +++ b/src/messages/MMDSScrubStats.h @@ -68,7 +68,7 @@ protected: ~MMDSScrubStats() override {} private: - unsigned epoch; + uint32_t epoch; std::set scrubbing_tags; bool update_scrubbing = false; bool aborting = false;