From: Kefu Chai Date: Fri, 17 Aug 2018 09:14:28 +0000 (+0800) Subject: messages: define HEAD_VERSION and COMPAT_VERSION inlined X-Git-Tag: v14.0.1~570^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23623%2Fhead;p=ceph.git messages: define HEAD_VERSION and COMPAT_VERSION inlined otherwise we could have ../lib/libceph-common.so.0: undefined reference to `MOSDPGNotify::HEAD_VERSION when the compiler tries to be smart and pass them by reference. Signed-off-by: Kefu Chai --- diff --git a/src/messages/MBackfillReserve.h b/src/messages/MBackfillReserve.h index b8d64f825e30..c9c1f6bcac19 100644 --- a/src/messages/MBackfillReserve.h +++ b/src/messages/MBackfillReserve.h @@ -22,8 +22,8 @@ class MBackfillReserve : public MessageInstance public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 4; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 4; public: spg_t pgid; epoch_t query_epoch; diff --git a/src/messages/MClientCapRelease.h b/src/messages/MClientCapRelease.h index 8106d621c640..76a4aae17d70 100644 --- a/src/messages/MClientCapRelease.h +++ b/src/messages/MClientCapRelease.h @@ -23,8 +23,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; public: struct ceph_mds_cap_release head; diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index 38abc02437ba..c48c478f0f1d 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -23,13 +23,13 @@ public: friend factory; private: - static const int HEAD_VERSION = 11; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 11; + static constexpr int COMPAT_VERSION = 1; public: - static const unsigned FLAG_SYNC = (1<<0); - static const unsigned FLAG_NO_CAPSNAP = (1<<1); // unused - static const unsigned FLAG_PENDING_CAPSNAP = (1<<2); + static constexpr unsigned FLAG_SYNC = (1<<0); + static constexpr unsigned FLAG_NO_CAPSNAP = (1<<1); // unused + static constexpr unsigned FLAG_PENDING_CAPSNAP = (1<<2); struct ceph_mds_caps_head head; diff --git a/src/messages/MClientReconnect.h b/src/messages/MClientReconnect.h index 96e9b210e845..47ac931c9df6 100644 --- a/src/messages/MClientReconnect.h +++ b/src/messages/MClientReconnect.h @@ -24,7 +24,7 @@ class MClientReconnect : public MessageInstance { public: friend factory; private: - const static int HEAD_VERSION = 3; + static constexpr int HEAD_VERSION = 3; public: map caps; // only head inodes diff --git a/src/messages/MClientRequest.h b/src/messages/MClientRequest.h index f190979a9c50..d109ca59b5b5 100644 --- a/src/messages/MClientRequest.h +++ b/src/messages/MClientRequest.h @@ -52,8 +52,8 @@ class MClientRequest : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 1; public: mutable struct ceph_mds_request_head head; /* XXX HACK! */ diff --git a/src/messages/MClientSession.h b/src/messages/MClientSession.h index a672812fc29d..9fa79cf9fb89 100644 --- a/src/messages/MClientSession.h +++ b/src/messages/MClientSession.h @@ -22,8 +22,8 @@ class MClientSession : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 1; public: ceph_mds_session_head head; diff --git a/src/messages/MConfig.h b/src/messages/MConfig.h index ca79b9aa39ef..ab5d6a94b372 100644 --- a/src/messages/MConfig.h +++ b/src/messages/MConfig.h @@ -9,8 +9,8 @@ class MConfig : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; map config; diff --git a/src/messages/MDataPing.h b/src/messages/MDataPing.h index 664e7ebcbbe2..b05d06c8c90f 100644 --- a/src/messages/MDataPing.h +++ b/src/messages/MDataPing.h @@ -32,8 +32,8 @@ class MDataPing : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; std::string tag; uint32_t counter = 0; diff --git a/src/messages/MDiscoverReply.h b/src/messages/MDiscoverReply.h index a25fa135a6d1..c5ab5c81e7d2 100644 --- a/src/messages/MDiscoverReply.h +++ b/src/messages/MDiscoverReply.h @@ -67,7 +67,7 @@ class MDiscoverReply : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; + static constexpr int HEAD_VERSION = 2; // info about original request inodeno_t base_ino; diff --git a/src/messages/MExportCaps.h b/src/messages/MExportCaps.h index 0b91f48ac4b6..006a37526ae4 100644 --- a/src/messages/MExportCaps.h +++ b/src/messages/MExportCaps.h @@ -23,9 +23,9 @@ class MExportCaps : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; - public: + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; +public: inodeno_t ino; bufferlist cap_bl; map client_map; diff --git a/src/messages/MForward.h b/src/messages/MForward.h index 9b34c086f95a..2067d52a1934 100644 --- a/src/messages/MForward.h +++ b/src/messages/MForward.h @@ -39,8 +39,8 @@ public: string msg_desc; // for operator<< only - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 4; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 4; MForward() : MessageInstance(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION), tid(0), con_features(0), msg(NULL) {} diff --git a/src/messages/MGetConfig.h b/src/messages/MGetConfig.h index 11fc6c6fabbc..2bbf1170373c 100644 --- a/src/messages/MGetConfig.h +++ b/src/messages/MGetConfig.h @@ -9,8 +9,8 @@ class MGetConfig : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; EntityName name; ///< e.g., mon.a, client.foo string host; ///< our hostname diff --git a/src/messages/MMDSBeacon.h b/src/messages/MMDSBeacon.h index e72e20d1068a..6e1433d614cd 100644 --- a/src/messages/MMDSBeacon.h +++ b/src/messages/MMDSBeacon.h @@ -184,8 +184,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 7; - static const int COMPAT_VERSION = 6; + static constexpr int HEAD_VERSION = 7; + static constexpr int COMPAT_VERSION = 6; uuid_d fsid; mds_gid_t global_id; diff --git a/src/messages/MMDSCacheRejoin.h b/src/messages/MMDSCacheRejoin.h index 66e788b0bd7a..3eef9f717c16 100644 --- a/src/messages/MMDSCacheRejoin.h +++ b/src/messages/MMDSCacheRejoin.h @@ -32,13 +32,13 @@ public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; public: - static const int OP_WEAK = 1; // replica -> auth, i exist, + maybe open files. - static const int OP_STRONG = 2; // replica -> auth, i exist, + open files and lock state. - static const int OP_ACK = 3; // auth -> replica, here is your lock state. + static constexpr int OP_WEAK = 1; // replica -> auth, i exist, + maybe open files. + static constexpr int OP_STRONG = 2; // replica -> auth, i exist, + open files and lock state. + static constexpr int OP_ACK = 3; // auth -> replica, here is your lock state. static const char *get_opname(int op) { switch (op) { case OP_WEAK: return "weak"; diff --git a/src/messages/MMDSMap.h b/src/messages/MMDSMap.h index 482d32a5b1cb..2fef2beb53d7 100644 --- a/src/messages/MMDSMap.h +++ b/src/messages/MMDSMap.h @@ -24,9 +24,8 @@ class MMDSMap : public MessageInstance { public: friend factory; private: - - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; public: uuid_d fsid; epoch_t epoch = 0; diff --git a/src/messages/MMDSSlaveRequest.h b/src/messages/MMDSSlaveRequest.h index 9e80aff627f8..97e7cfd07a95 100644 --- a/src/messages/MMDSSlaveRequest.h +++ b/src/messages/MMDSSlaveRequest.h @@ -23,39 +23,39 @@ class MMDSSlaveRequest : public MessageInstance { public: friend factory; - static const int OP_XLOCK = 1; - static const int OP_XLOCKACK = -1; - static const int OP_UNXLOCK = 2; - static const int OP_AUTHPIN = 3; - static const int OP_AUTHPINACK = -3; + static constexpr int OP_XLOCK = 1; + static constexpr int OP_XLOCKACK = -1; + static constexpr int OP_UNXLOCK = 2; + static constexpr int OP_AUTHPIN = 3; + static constexpr int OP_AUTHPINACK = -3; - static const int OP_LINKPREP = 4; - static const int OP_UNLINKPREP = 5; - static const int OP_LINKPREPACK = -4; + static constexpr int OP_LINKPREP = 4; + static constexpr int OP_UNLINKPREP = 5; + static constexpr int OP_LINKPREPACK = -4; - static const int OP_RENAMEPREP = 7; - static const int OP_RENAMEPREPACK = -7; + static constexpr int OP_RENAMEPREP = 7; + static constexpr int OP_RENAMEPREPACK = -7; - static const int OP_WRLOCK = 8; - static const int OP_WRLOCKACK = -8; - static const int OP_UNWRLOCK = 9; + static constexpr int OP_WRLOCK = 8; + static constexpr int OP_WRLOCKACK = -8; + static constexpr int OP_UNWRLOCK = 9; - static const int OP_RMDIRPREP = 10; - static const int OP_RMDIRPREPACK = -10; + static constexpr int OP_RMDIRPREP = 10; + static constexpr int OP_RMDIRPREPACK = -10; - static const int OP_DROPLOCKS = 11; + static constexpr int OP_DROPLOCKS = 11; - static const int OP_RENAMENOTIFY = 12; - static const int OP_RENAMENOTIFYACK = -12; + static constexpr int OP_RENAMENOTIFY = 12; + static constexpr int OP_RENAMENOTIFYACK = -12; - static const int OP_FINISH = 17; - static const int OP_COMMITTED = -18; + static constexpr int OP_FINISH = 17; + static constexpr int OP_COMMITTED = -18; - static const int OP_ABORT = 20; // used for recovery only - //static const int OP_COMMIT = 21; // used for recovery only + static constexpr int OP_ABORT = 20; // used for recovery only + //static constexpr int OP_COMMIT = 21; // used for recovery only - static const char *get_opname(int o) { + static constexpr char *get_opname(int o) { switch (o) { case OP_XLOCK: return "xlock"; case OP_XLOCKACK: return "xlock_ack"; @@ -98,12 +98,12 @@ public: __s16 op; mutable __u16 flags; /* XXX HACK for mark_interrupted */ - static const unsigned FLAG_NONBLOCK = 1<<0; - static const unsigned FLAG_WOULDBLOCK = 1<<1; - static const unsigned FLAG_NOTJOURNALED = 1<<2; - static const unsigned FLAG_EROFS = 1<<3; - static const unsigned FLAG_ABORT = 1<<4; - static const unsigned FLAG_INTERRUPTED = 1<<5; + static constexpr unsigned FLAG_NONBLOCK = 1<<0; + static constexpr unsigned FLAG_WOULDBLOCK = 1<<1; + static constexpr unsigned FLAG_NOTJOURNALED = 1<<2; + static constexpr unsigned FLAG_EROFS = 1<<3; + static constexpr unsigned FLAG_ABORT = 1<<4; + static constexpr unsigned FLAG_INTERRUPTED = 1<<5; // for locking __u16 lock_type; // lock object type diff --git a/src/messages/MMgrBeacon.h b/src/messages/MMgrBeacon.h index 58905771db67..789496131c3f 100644 --- a/src/messages/MMgrBeacon.h +++ b/src/messages/MMgrBeacon.h @@ -27,8 +27,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 8; - static const int COMPAT_VERSION = 8; + static constexpr int HEAD_VERSION = 8; + static constexpr int COMPAT_VERSION = 8; protected: uint64_t gid; diff --git a/src/messages/MMgrClose.h b/src/messages/MMgrClose.h index 6d35e9ba7b7b..25c31919e661 100644 --- a/src/messages/MMgrClose.h +++ b/src/messages/MMgrClose.h @@ -10,8 +10,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; public: std::string daemon_name; diff --git a/src/messages/MMgrConfigure.h b/src/messages/MMgrConfigure.h index 3f1ff9b00ab5..34a981ba9a93 100644 --- a/src/messages/MMgrConfigure.h +++ b/src/messages/MMgrConfigure.h @@ -26,8 +26,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; public: uint32_t stats_period = 0; diff --git a/src/messages/MMgrOpen.h b/src/messages/MMgrOpen.h index 721668c4b523..0328f159d730 100644 --- a/src/messages/MMgrOpen.h +++ b/src/messages/MMgrOpen.h @@ -22,8 +22,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 1; public: diff --git a/src/messages/MMgrReport.h b/src/messages/MMgrReport.h index 232e97400ded..e1f69bba4e88 100644 --- a/src/messages/MMgrReport.h +++ b/src/messages/MMgrReport.h @@ -75,8 +75,8 @@ public: friend factory; private: - static const int HEAD_VERSION = 6; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 6; + static constexpr int COMPAT_VERSION = 1; public: /** diff --git a/src/messages/MMonElection.h b/src/messages/MMonElection.h index 2e838b0bf750..c296bc0507c2 100644 --- a/src/messages/MMonElection.h +++ b/src/messages/MMonElection.h @@ -25,14 +25,14 @@ public: friend factory; private: - static const int HEAD_VERSION = 7; - static const int COMPAT_VERSION = 5; + static constexpr int HEAD_VERSION = 7; + static constexpr int COMPAT_VERSION = 5; public: - static const int OP_PROPOSE = 1; - static const int OP_ACK = 2; - static const int OP_NAK = 3; - static const int OP_VICTORY = 4; + static constexpr int OP_PROPOSE = 1; + static constexpr int OP_ACK = 2; + static constexpr int OP_NAK = 3; + static constexpr int OP_VICTORY = 4; static const char *get_opname(int o) { switch (o) { case OP_PROPOSE: return "propose"; diff --git a/src/messages/MMonGetVersionReply.h b/src/messages/MMonGetVersionReply.h index 1eb3f567b331..c49b4023b28f 100644 --- a/src/messages/MMonGetVersionReply.h +++ b/src/messages/MMonGetVersionReply.h @@ -28,7 +28,7 @@ class MMonGetVersionReply : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; + static constexpr int HEAD_VERSION = 2; public: MMonGetVersionReply() : MessageInstance(CEPH_MSG_MON_GET_VERSION_REPLY, HEAD_VERSION) { } diff --git a/src/messages/MMonHealth.h b/src/messages/MMonHealth.h index 393bb8040468..f076e8675f4b 100644 --- a/src/messages/MMonHealth.h +++ b/src/messages/MMonHealth.h @@ -22,7 +22,7 @@ class MMonHealth : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; + static constexpr int HEAD_VERSION = 1; int service_type = 0; int service_op = 0; diff --git a/src/messages/MMonHealthChecks.h b/src/messages/MMonHealthChecks.h index eeb8bac23c63..e69304a11cd7 100644 --- a/src/messages/MMonHealthChecks.h +++ b/src/messages/MMonHealthChecks.h @@ -11,8 +11,8 @@ class MMonHealthChecks : public MessageInstance public: friend factory; private: - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; public: // PGMapDigest is in data payload diff --git a/src/messages/MMonPaxos.h b/src/messages/MMonPaxos.h index 56ab8c5c0159..02d202dff0a3 100644 --- a/src/messages/MMonPaxos.h +++ b/src/messages/MMonPaxos.h @@ -24,18 +24,18 @@ class MMonPaxos : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 3; public: // op types - const static int OP_COLLECT = 1; // proposer: propose round - const static int OP_LAST = 2; // voter: accept proposed round - const static int OP_BEGIN = 3; // proposer: value proposed for this round - const static int OP_ACCEPT = 4; // voter: accept propsed value - const static int OP_COMMIT = 5; // proposer: notify learners of agreed value - const static int OP_LEASE = 6; // leader: extend peon lease - const static int OP_LEASE_ACK = 7; // peon: lease ack + static constexpr int OP_COLLECT = 1; // proposer: propose round + static constexpr int OP_LAST = 2; // voter: accept proposed round + static constexpr int OP_BEGIN = 3; // proposer: value proposed for this round + static constexpr int OP_ACCEPT = 4; // voter: accept propsed value + static constexpr int OP_COMMIT = 5; // proposer: notify learners of agreed value + static constexpr int OP_LEASE = 6; // leader: extend peon lease + static constexpr int OP_LEASE_ACK = 7; // peon: lease ack const static char *get_opname(int op) { switch (op) { case OP_COLLECT: return "collect"; diff --git a/src/messages/MMonProbe.h b/src/messages/MMonProbe.h index 2ee68de71e99..e244c3a94b58 100644 --- a/src/messages/MMonProbe.h +++ b/src/messages/MMonProbe.h @@ -24,8 +24,8 @@ class MMonProbe : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 6; - static const int COMPAT_VERSION = 5; + static constexpr int HEAD_VERSION = 6; + static constexpr int COMPAT_VERSION = 5; enum { OP_PROBE = 1, diff --git a/src/messages/MMonScrub.h b/src/messages/MMonScrub.h index 023fbdcd9d37..cb04ac2e85e6 100644 --- a/src/messages/MMonScrub.h +++ b/src/messages/MMonScrub.h @@ -20,8 +20,8 @@ class MMonScrub : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; public: typedef enum { diff --git a/src/messages/MMonSubscribe.h b/src/messages/MMonSubscribe.h index bce11d3fc6ac..eafcf0b055b4 100644 --- a/src/messages/MMonSubscribe.h +++ b/src/messages/MMonSubscribe.h @@ -33,8 +33,8 @@ class MMonSubscribe : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 1; string hostname; map what; diff --git a/src/messages/MMonSync.h b/src/messages/MMonSync.h index c7c9d20d5e1c..0f2f34862300 100644 --- a/src/messages/MMonSync.h +++ b/src/messages/MMonSync.h @@ -19,8 +19,8 @@ class MMonSync : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; public: /** diff --git a/src/messages/MNop.h b/src/messages/MNop.h index 73f778cebd97..018eafe17810 100644 --- a/src/messages/MNop.h +++ b/src/messages/MNop.h @@ -26,8 +26,8 @@ class MNop : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; __u32 tag; // ignored tag value diff --git a/src/messages/MOSDBoot.h b/src/messages/MOSDBoot.h index a76b07a4cafb..eeaa7fefe508 100644 --- a/src/messages/MOSDBoot.h +++ b/src/messages/MOSDBoot.h @@ -24,8 +24,8 @@ class MOSDBoot : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 6; - static const int COMPAT_VERSION = 6; + static constexpr int HEAD_VERSION = 6; + static constexpr int COMPAT_VERSION = 6; public: OSDSuperblock sb; diff --git a/src/messages/MOSDECSubOpRead.h b/src/messages/MOSDECSubOpRead.h index e1cdb78e06cb..a2d63015f20d 100644 --- a/src/messages/MOSDECSubOpRead.h +++ b/src/messages/MOSDECSubOpRead.h @@ -22,8 +22,8 @@ class MOSDECSubOpRead : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 4; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 4; public: enum { diff --git a/src/messages/MOSDForceRecovery.h b/src/messages/MOSDForceRecovery.h index 2a5b37f2443b..eba5e5c93b29 100644 --- a/src/messages/MOSDForceRecovery.h +++ b/src/messages/MOSDForceRecovery.h @@ -35,8 +35,8 @@ class MOSDForceRecovery : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; uuid_d fsid; vector forced_pgs; diff --git a/src/messages/MOSDMap.h b/src/messages/MOSDMap.h index 7ff35ba79ef1..a8822e7b3e47 100644 --- a/src/messages/MOSDMap.h +++ b/src/messages/MOSDMap.h @@ -24,8 +24,8 @@ class MOSDMap : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 3; public: uuid_d fsid; diff --git a/src/messages/MOSDMarkMeDown.h b/src/messages/MOSDMarkMeDown.h index ce773fae32dd..23523950e9d1 100644 --- a/src/messages/MOSDMarkMeDown.h +++ b/src/messages/MOSDMarkMeDown.h @@ -21,8 +21,8 @@ class MOSDMarkMeDown : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 8; - static const int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 8; + static constexpr int COMPAT_VERSION = 3; private: uint32_t client_inc = 0; diff --git a/src/messages/MOSDOpReply.h b/src/messages/MOSDOpReply.h index 21422dd2f481..1e5edd4b42c4 100644 --- a/src/messages/MOSDOpReply.h +++ b/src/messages/MOSDOpReply.h @@ -34,8 +34,8 @@ class MOSDOpReply : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 8; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 8; + static constexpr int COMPAT_VERSION = 2; object_t oid; pg_t pgid; diff --git a/src/messages/MOSDPGBackfill.h b/src/messages/MOSDPGBackfill.h index e57a38ccd539..45e9aa9cdadb 100644 --- a/src/messages/MOSDPGBackfill.h +++ b/src/messages/MOSDPGBackfill.h @@ -21,8 +21,8 @@ class MOSDPGBackfill : public MessageInstance { public: friend factory; - const static int HEAD_VERSION = 3; - const static int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 3; version_t epoch = 0; map mkpg; diff --git a/src/messages/MOSDPGCreate2.h b/src/messages/MOSDPGCreate2.h index 83cfc28ebe75..3dd2e2069f7c 100644 --- a/src/messages/MOSDPGCreate2.h +++ b/src/messages/MOSDPGCreate2.h @@ -14,8 +14,8 @@ class MOSDPGCreate2 : public MessageInstance { public: friend factory; - const static int HEAD_VERSION = 1; - const static int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; epoch_t epoch = 0; map> pgs; diff --git a/src/messages/MOSDPGInfo.h b/src/messages/MOSDPGInfo.h index 336a61d5b6bd..8434651e4b87 100644 --- a/src/messages/MOSDPGInfo.h +++ b/src/messages/MOSDPGInfo.h @@ -23,8 +23,8 @@ class MOSDPGInfo : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 5; - static const int COMPAT_VERSION = 5; + static constexpr int HEAD_VERSION = 5; + static constexpr int COMPAT_VERSION = 5; epoch_t epoch = 0; diff --git a/src/messages/MOSDPGLog.h b/src/messages/MOSDPGLog.h index 4025c8f0d559..86e65baeb849 100644 --- a/src/messages/MOSDPGLog.h +++ b/src/messages/MOSDPGLog.h @@ -22,8 +22,8 @@ class MOSDPGLog : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 5; - static const int COMPAT_VERSION = 5; + static constexpr int HEAD_VERSION = 5; + static constexpr int COMPAT_VERSION = 5; epoch_t epoch = 0; /// query_epoch is the epoch of the query being responded to, or diff --git a/src/messages/MOSDPGNotify.h b/src/messages/MOSDPGNotify.h index 5cbf6569bc91..2447525b4cbb 100644 --- a/src/messages/MOSDPGNotify.h +++ b/src/messages/MOSDPGNotify.h @@ -27,8 +27,8 @@ class MOSDPGNotify : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 6; - static const int COMPAT_VERSION = 6; + static constexpr int HEAD_VERSION = 6; + static constexpr int COMPAT_VERSION = 6; epoch_t epoch = 0; /// query_epoch is the epoch of the query being responded to, or diff --git a/src/messages/MOSDPGPull.h b/src/messages/MOSDPGPull.h index 79c13a19e64c..85043e021b06 100644 --- a/src/messages/MOSDPGPull.h +++ b/src/messages/MOSDPGPull.h @@ -21,8 +21,8 @@ class MOSDPGPull : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 2; vector pulls; diff --git a/src/messages/MOSDPGPush.h b/src/messages/MOSDPGPush.h index 77864cceabaf..611dbd9b361c 100644 --- a/src/messages/MOSDPGPush.h +++ b/src/messages/MOSDPGPush.h @@ -21,8 +21,8 @@ class MOSDPGPush : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 2; public: pg_shard_t from; diff --git a/src/messages/MOSDPGPushReply.h b/src/messages/MOSDPGPushReply.h index dc0d6bfb98d2..a5c5d880e442 100644 --- a/src/messages/MOSDPGPushReply.h +++ b/src/messages/MOSDPGPushReply.h @@ -21,8 +21,8 @@ class MOSDPGPushReply : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 4; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 4; version_t epoch = 0; diff --git a/src/messages/MOSDPGRecoveryDelete.h b/src/messages/MOSDPGRecoveryDelete.h index ac4152567fad..4774978213a6 100644 --- a/src/messages/MOSDPGRecoveryDelete.h +++ b/src/messages/MOSDPGRecoveryDelete.h @@ -14,8 +14,8 @@ class MOSDPGRecoveryDelete : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 3; epoch_t epoch = 0; diff --git a/src/messages/MOSDPGScan.h b/src/messages/MOSDPGScan.h index 4da8aac5128b..04db4ae61659 100644 --- a/src/messages/MOSDPGScan.h +++ b/src/messages/MOSDPGScan.h @@ -21,8 +21,8 @@ class MOSDPGScan : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; public: enum { diff --git a/src/messages/MOSDPGTrim.h b/src/messages/MOSDPGTrim.h index ce8312dcaeed..2ec971d4dedb 100644 --- a/src/messages/MOSDPGTrim.h +++ b/src/messages/MOSDPGTrim.h @@ -22,8 +22,8 @@ class MOSDPGTrim : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; public: epoch_t epoch = 0; diff --git a/src/messages/MOSDPGUpdateLogMissing.h b/src/messages/MOSDPGUpdateLogMissing.h index 1764c23f1b55..f3db4bf935b9 100644 --- a/src/messages/MOSDPGUpdateLogMissing.h +++ b/src/messages/MOSDPGUpdateLogMissing.h @@ -22,8 +22,8 @@ class MOSDPGUpdateLogMissing : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 4; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 4; public: enum { diff --git a/src/messages/MOSDRepOp.h b/src/messages/MOSDRepOp.h index daacad60406f..fc6d06c1f758 100644 --- a/src/messages/MOSDRepOp.h +++ b/src/messages/MOSDRepOp.h @@ -26,8 +26,8 @@ class MOSDRepOp : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; public: epoch_t map_epoch, min_epoch; diff --git a/src/messages/MOSDRepOpReply.h b/src/messages/MOSDRepOpReply.h index 239864846586..8f158bce0abd 100644 --- a/src/messages/MOSDRepOpReply.h +++ b/src/messages/MOSDRepOpReply.h @@ -32,8 +32,8 @@ class MOSDRepOpReply : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 9; - static const int COMPAT_VERSION = 6; + static constexpr int HEAD_VERSION = 9; + static constexpr int COMPAT_VERSION = 6; spg_t pgid; // PG to scrub eversion_t scrub_from; // only scrub log entries after scrub_from diff --git a/src/messages/MOSDRepScrubMap.h b/src/messages/MOSDRepScrubMap.h index 96705d0f51da..45a736cbff54 100644 --- a/src/messages/MOSDRepScrubMap.h +++ b/src/messages/MOSDRepScrubMap.h @@ -25,8 +25,8 @@ class MOSDRepScrubMap : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 2; uuid_d fsid; vector scrub_pgs; diff --git a/src/messages/MOSDScrub2.h b/src/messages/MOSDScrub2.h index 28e1d2a3bf32..6e1a6145f77e 100644 --- a/src/messages/MOSDScrub2.h +++ b/src/messages/MOSDScrub2.h @@ -13,8 +13,8 @@ class MOSDScrub2 : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; uuid_d fsid; epoch_t epoch; diff --git a/src/messages/MOSDScrubReserve.h b/src/messages/MOSDScrubReserve.h index 5cab78d59d24..c8966c1a6ce9 100644 --- a/src/messages/MOSDScrubReserve.h +++ b/src/messages/MOSDScrubReserve.h @@ -21,8 +21,8 @@ class MOSDScrubReserve : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 4; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 4; + static constexpr int COMPAT_VERSION = 2; public: uuid_d fsid; diff --git a/src/messages/MRecoveryReserve.h b/src/messages/MRecoveryReserve.h index 344eae5516b3..ae10f3634957 100644 --- a/src/messages/MRecoveryReserve.h +++ b/src/messages/MRecoveryReserve.h @@ -22,8 +22,8 @@ class MRecoveryReserve : public MessageInstance public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 2; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 2; public: spg_t pgid; epoch_t query_epoch; diff --git a/src/messages/MRoute.h b/src/messages/MRoute.h index b858abe414bb..1e35a0b2bca4 100644 --- a/src/messages/MRoute.h +++ b/src/messages/MRoute.h @@ -24,8 +24,8 @@ class MRoute : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 3; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 3; uint64_t session_mon_tid; Message *msg; diff --git a/src/messages/MStatfs.h b/src/messages/MStatfs.h index 71f2d7fea555..45601d78d330 100644 --- a/src/messages/MStatfs.h +++ b/src/messages/MStatfs.h @@ -23,8 +23,8 @@ class MStatfs : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 2; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 2; + static constexpr int COMPAT_VERSION = 1; public: uuid_d fsid; diff --git a/src/messages/MTimeCheck.h b/src/messages/MTimeCheck.h index 5905c6b6a757..628640a75342 100644 --- a/src/messages/MTimeCheck.h +++ b/src/messages/MTimeCheck.h @@ -19,7 +19,7 @@ class MTimeCheck : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; + static constexpr int HEAD_VERSION = 1; enum { OP_PING = 1, diff --git a/src/messages/MTimeCheck2.h b/src/messages/MTimeCheck2.h index 56243d10a92e..6c100c672b0f 100644 --- a/src/messages/MTimeCheck2.h +++ b/src/messages/MTimeCheck2.h @@ -18,8 +18,8 @@ class MTimeCheck2 : public MessageInstance { public: friend factory; - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; enum { OP_PING = 1, diff --git a/src/messages/MWatchNotify.h b/src/messages/MWatchNotify.h index 1300ba6d92e7..8da4738b35a1 100644 --- a/src/messages/MWatchNotify.h +++ b/src/messages/MWatchNotify.h @@ -23,8 +23,8 @@ class MWatchNotify : public MessageInstance { public: friend factory; private: - static const int HEAD_VERSION = 3; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 3; + static constexpr int COMPAT_VERSION = 1; public: uint64_t cookie; ///< client unique id for this watch or notify diff --git a/src/mon/mon_types.h b/src/mon/mon_types.h index 841353019d82..095e1874cdae 100644 --- a/src/mon/mon_types.h +++ b/src/mon/mon_types.h @@ -318,8 +318,8 @@ inline const char *ceph_mon_feature_name(uint64_t b) class mon_feature_t { - static const int HEAD_VERSION = 1; - static const int COMPAT_VERSION = 1; + static constexpr int HEAD_VERSION = 1; + static constexpr int COMPAT_VERSION = 1; // mon-specific features uint64_t features;