]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: set type in default constructor
authorSage Weil <sage.weil@dreamhost.com>
Fri, 3 Feb 2012 05:03:08 +0000 (21:03 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 3 Feb 2012 05:06:33 +0000 (21:06 -0800)
ceph-dencoder wants this to verify it decoded the correct message type.
Not that it is likely to happen, but let's be pendantic about it anyway.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
30 files changed:
src/messages/MCacheExpire.h
src/messages/MClientCaps.h
src/messages/MClientReply.h
src/messages/MDirUpdate.h
src/messages/MDiscover.h
src/messages/MDiscoverReply.h
src/messages/MExportDir.h
src/messages/MExportDirAck.h
src/messages/MExportDirCancel.h
src/messages/MExportDirDiscoverAck.h
src/messages/MHeartbeat.h
src/messages/MInodeFileCaps.h
src/messages/MLock.h
src/messages/MMDSFragmentNotify.h
src/messages/MMDSTableRequest.h
src/messages/MOSDOp.h
src/messages/MOSDOpReply.h
src/messages/MOSDPGCreate.h
src/messages/MOSDPGInfo.h
src/messages/MOSDPGLog.h
src/messages/MOSDPGMissing.h
src/messages/MOSDPGNotify.h
src/messages/MOSDPGQuery.h
src/messages/MOSDPGRemove.h
src/messages/MOSDPGTrim.h
src/messages/MOSDPing.h
src/messages/MOSDRepScrub.h
src/messages/MOSDScrub.h
src/messages/MOSDSubOp.h
src/messages/MOSDSubOpReply.h

index 3e1b0e6ab4991b3dd4a4310d25a000b76a504807..717998d0b97dbd5c0eeb14b513ea980b12db7007 100644 (file)
@@ -47,7 +47,7 @@ public:
 
   int get_from() { return from; }
 
-  MCacheExpire() {}
+  MCacheExpire() : Message(MSG_MDS_CACHEEXPIRE) {}
   MCacheExpire(int f) : 
     Message(MSG_MDS_CACHEEXPIRE),
     from(f) { }
index d515304f93e6f88b01ce5109f8051217c085d0a5..f68e033618671264b91f64cd1cbd2b896494b5c2 100644 (file)
@@ -69,7 +69,7 @@ class MClientCaps : public Message {
   void set_mtime(const utime_t &t) { t.encode_timeval(&head.mtime); }
   void set_atime(const utime_t &t) { t.encode_timeval(&head.atime); }
 
-  MClientCaps() {}
+  MClientCaps() : Message(CEPH_MSG_CLIENT_CAPS) {}
   MClientCaps(int op,
              inodeno_t ino,
              inodeno_t realm,
index ee3dbb92a4fb6dd6fbf07e2565fc638f39ceb01c..a2803ef9ded55d6d30a832ec251eeac13b656292 100644 (file)
@@ -199,7 +199,7 @@ public:
 
   bool is_safe() const { return head.safe; }
 
-  MClientReply() {}
+  MClientReply() : Message(CEPH_MSG_CLIENT_REPLY) {}
   MClientReply(MClientRequest *req, int result = 0) : 
     Message(CEPH_MSG_CLIENT_REPLY) {
     memset(&head, 0, sizeof(head));
index e9914c235c7370111dcc78ba9bcab8843d391d04..445cd828cfe9823a7de54aa981040ebbb6fbcccb 100644 (file)
@@ -38,7 +38,7 @@ class MDirUpdate : public Message {
     if (discover) discover--;
   }
 
-  MDirUpdate() {}
+  MDirUpdate() : Message(MSG_MDS_DIRUPDATE) {}
   MDirUpdate(int f, 
             dirfrag_t dirfrag,
              int dir_rep,
index 937b51ec92f04104346fa64cd756de40d0106668..296825ccc8b91674d48295d0a22174fa836edde3 100644 (file)
@@ -49,7 +49,7 @@ class MDiscover : public Message {
   
   void set_base_dir_frag(frag_t f) { base_dir_frag = f; }
 
-  MDiscover() { }
+  MDiscover() : Message(MSG_MDS_DISCOVER) { }
   MDiscover(inodeno_t base_ino_,
            frag_t base_frag_,
            snapid_t s,
index 7a41be1e3f65cb8d48dab49ab1ffd20e55d9b786..bad3386c3efb1f4d2e64116706dce61e67dc43a0 100644 (file)
@@ -112,7 +112,7 @@ class MDiscoverReply : public Message {
   void set_base_dir_frag(frag_t df) { base_dir_frag = df; }
 
   // cons
-  MDiscoverReply() {}
+  MDiscoverReply() : Message(MSG_MDS_DISCOVERREPLY) {}
   MDiscoverReply(MDiscover *dis) :
     Message(MSG_MDS_DISCOVERREPLY),
     base_ino(dis->get_base_ino()),
index 4f74e7a926ee12e91eb3d8ebb0ee033e3e9e9b06..688526d8dcdcbb9cb44982dbb33444440d0bd73c 100644 (file)
@@ -26,7 +26,7 @@ class MExportDir : public Message {
   vector<dirfrag_t> bounds;
   bufferlist client_map;
 
-  MExportDir() {}
+  MExportDir() : Message(MSG_MDS_EXPORTDIR) {}
   MExportDir(dirfrag_t df) : 
     Message(MSG_MDS_EXPORTDIR),
     dirfrag(df) {
index 8ad79d9f96189f62300759c20a235666a2dab6e6..42c5c5d48cea9c8db61597f36892702f20b6fe17 100644 (file)
@@ -23,7 +23,7 @@ class MExportDirAck : public Message {
  public:
   dirfrag_t get_dirfrag() { return dirfrag; }
   
-  MExportDirAck() {}
+  MExportDirAck() : Message(MSG_MDS_EXPORTDIRACK) {}
   MExportDirAck(dirfrag_t i) :
     Message(MSG_MDS_EXPORTDIRACK), dirfrag(i) { }
 private:
index 52f7b124fa94e3fca99628f7ed5dc8a68b0b4057..9cd06021bd49205da3db19426245dce8bbd7a9da 100644 (file)
@@ -24,7 +24,7 @@ class MExportDirCancel : public Message {
  public:
   dirfrag_t get_dirfrag() { return dirfrag; }
 
-  MExportDirCancel() {}
+  MExportDirCancel() : Message(MSG_MDS_EXPORTDIRCANCEL) {}
   MExportDirCancel(dirfrag_t df) : 
     Message(MSG_MDS_EXPORTDIRCANCEL),
        dirfrag(df) { }
index 2aafc7400b8b8ae964265ba5f23e3a43e644eeb1..82eeb5ea82c3d0d021f4e4610f1457689e482d4a 100644 (file)
@@ -27,7 +27,7 @@ class MExportDirDiscoverAck : public Message {
   dirfrag_t get_dirfrag() { return dirfrag; }
   bool is_success() { return success; }
 
-  MExportDirDiscoverAck() {}
+  MExportDirDiscoverAck() : Message(MSG_MDS_EXPORTDIRDISCOVERACK) {}
   MExportDirDiscoverAck(dirfrag_t df, bool s=true) : 
     Message(MSG_MDS_EXPORTDIRDISCOVERACK),
     dirfrag(df),
index bddffc0b001401945aad44d4cdd2543c00e5f8ca..b6cfcfaf0106e7edfea05d5afdafcf1db4809ef7 100644 (file)
@@ -33,13 +33,10 @@ class MHeartbeat : public Message {
   }
 
   MHeartbeat()
-    : load(utime_t())
-  {
-  }
-  MHeartbeat(mds_load_t& load, int beat) :
-    Message(MSG_MDS_HEARTBEAT),
-    load(load)
-  {
+    : Message(MSG_MDS_HEARTBEAT), load(utime_t()) { }
+  MHeartbeat(mds_load_t& load, int beat)
+    : Message(MSG_MDS_HEARTBEAT),
+      load(load) {
     this->beat = beat;
   }
 private:
index b5fc0ddd3461a6a5684f379630b7639cdeb75c6f..bc4db2fc60a9fe0dbe500c975d3984629a3cd845 100644 (file)
@@ -24,7 +24,7 @@ class MInodeFileCaps : public Message {
   inodeno_t get_ino() { return ino; }
   int       get_caps() { return caps; }
 
-  MInodeFileCaps() {}
+  MInodeFileCaps() : Message(MSG_MDS_INODEFILECAPS) {}
   MInodeFileCaps(inodeno_t ino, int caps) :
     Message(MSG_MDS_INODEFILECAPS) {
     this->ino = ino;
index 66cbe212f388b7731bd38345df01e46b06113af5..5dd4a858be6cdaaa52a8772d583c0e950bcb0967 100644 (file)
@@ -39,7 +39,7 @@ public:
   int get_lock_type() { return lock_type; }
   MDSCacheObjectInfo &get_object_info() { return object_info; }
   
-  MLock() {}
+  MLock() : Message(MSG_MDS_LOCK) {}
   MLock(int ac, int as) :
     Message(MSG_MDS_LOCK),
     action(ac), asker(as),
index 10eb0c7d4029dc1fe8f2596dc160ba1394ed8eb4..2d86b57acc1ca5a71f3b428ff0a060c024c9e8c9 100644 (file)
@@ -31,7 +31,7 @@ class MMDSFragmentNotify : public Message {
 
   bufferlist basebl;
 
-  MMDSFragmentNotify() {}
+  MMDSFragmentNotify() : Message(MSG_MDS_FRAGMENTNOTIFY) {}
   MMDSFragmentNotify(inodeno_t i, frag_t bf, int b) :
        Message(MSG_MDS_FRAGMENTNOTIFY),
     ino(i), basefrag(bf), bits(b) { }
index fcbfcb8638e323f66bdfbbbdd9992a50227c4bf1..e67c1f3ef2dd74f52811ab62bb287ea87bd20984 100644 (file)
@@ -26,7 +26,7 @@ class MMDSTableRequest : public Message {
   uint64_t reqid;
   bufferlist bl;
 
-  MMDSTableRequest() {}
+  MMDSTableRequest() : Message(MSG_MDS_TABLE_REQUEST) {}
   MMDSTableRequest(int tab, int o, uint64_t r, version_t v=0) : 
     Message(MSG_MDS_TABLE_REQUEST),
     table(tab), op(o), reqid(r) {
index 1bca186f1acf24fe9f1f45bef3a0c81a9eebc825..b77d85500454c082c746ff72ba09b1ee7b4a2aa5 100644 (file)
@@ -114,7 +114,7 @@ public:
     rmw_flags(flags) {
     set_tid(tid);
   }
-  MOSDOp() : rmw_flags(0) {}
+  MOSDOp() : Message(CEPH_MSG_OSD_OP) {}
 private:
   ~MOSDOp() {}
 
index c60f834b69b1c966a8f20392d5ad8d1a50cd5b3f..8fe58a08e70616875000a9d38928ed55ec6721b1 100644 (file)
@@ -103,7 +103,7 @@ public:
     for (unsigned i = 0; i < ops.size(); i++)
       ops[i].op.payload_len = 0;
   }
-  MOSDOpReply() {}
+  MOSDOpReply() : Message(CEPH_MSG_OSD_OPREPLY) {}
 private:
   ~MOSDOpReply() {}
 
index 0efcb0145af09064bc0ec4f9697284f642c2086d..d9537363df8c16d296b48e370c7a22d61ef2f6a5 100644 (file)
@@ -44,7 +44,7 @@ struct MOSDPGCreate : public Message {
 
   map<pg_t,create_rec> mkpg;
 
-  MOSDPGCreate() {}
+  MOSDPGCreate() : Message(MSG_OSD_PG_CREATE) {}
   MOSDPGCreate(epoch_t e) :
     Message(MSG_OSD_PG_CREATE),
     epoch(e) { }
index 2dc6ebb996111a25cff2a094ed58a92b00e16f42..a79a6e66c7a06fa7c4e81c7d52e6b4a280335d60 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   epoch_t get_epoch() { return epoch; }
 
-  MOSDPGInfo() {}
+  MOSDPGInfo() : Message(MSG_OSD_PG_INFO) {}
   MOSDPGInfo(version_t mv) :
     Message(MSG_OSD_PG_INFO),
     epoch(mv) { }
index 41aca565c53aa9c32b65a44e6b17ee24a7b85152..3b925bedc580422451f3cc67aead230e5dc41812 100644 (file)
@@ -35,7 +35,7 @@ public:
   pg_t get_pgid() { return info.pgid; }
   epoch_t get_query_epoch() { return query_epoch; }
 
-  MOSDPGLog() {}
+  MOSDPGLog() : Message(MSG_OSD_PG_LOG) {}
   MOSDPGLog(version_t mv, pg_info_t& i) :
     Message(MSG_OSD_PG_LOG),
     epoch(mv), query_epoch(mv), info(i)  { }
index 20f61a4c72070b78597e5ab659777ec4f84d6e4a..024414b37913f918724fed359e3f4cecff702cfe 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   epoch_t get_epoch() { return epoch; }
 
-  MOSDPGMissing() {}
+  MOSDPGMissing() : Message(MSG_OSD_PG_MISSING) {}
   MOSDPGMissing(version_t mv, const pg_info_t &info_,
                const pg_missing_t &missing_)
     : Message(MSG_OSD_PG_MISSING), epoch(mv), info(info_),
index 9c5306ff9c8a28ea29b985ac6ea42abbd7fed90e..88a091729d7fbf493674a634feecf4795c10a15c 100644 (file)
@@ -37,7 +37,7 @@ class MOSDPGNotify : public Message {
   vector<pg_info_t>& get_pg_list() { return pg_list; }
   epoch_t get_query_epoch() { return query_epoch; }
 
-  MOSDPGNotify() {}
+  MOSDPGNotify() : Message(MSG_OSD_PG_NOTIFY) {}
   MOSDPGNotify(epoch_t e, vector<pg_info_t>& l, epoch_t query_epoch) :
     Message(MSG_OSD_PG_NOTIFY), epoch(e),
     query_epoch(query_epoch) {
index 358f4390726369e7a82300409c292244ea9d4569..0416673383e07fdd9570d01d59b87ecacff2cef1 100644 (file)
@@ -29,7 +29,7 @@ class MOSDPGQuery : public Message {
   version_t get_epoch() { return epoch; }
   map<pg_t,pg_query_t>  pg_list;
 
-  MOSDPGQuery() {}
+  MOSDPGQuery() : Message(MSG_OSD_PG_QUERY) {}
   MOSDPGQuery(epoch_t e, map<pg_t,pg_query_t>& ls) :
     Message(MSG_OSD_PG_QUERY),
     epoch(e) {
index bc8a343db0d1f00c2d669e865f1a0af8cea957c7..c6ec797466e4e870e83d5c39ebbf9d6a8f1fd604 100644 (file)
@@ -27,7 +27,7 @@ class MOSDPGRemove : public Message {
 
   epoch_t get_epoch() { return epoch; }
 
-  MOSDPGRemove() {}
+  MOSDPGRemove() : Message(MSG_OSD_PG_REMOVE) {}
   MOSDPGRemove(epoch_t e, vector<pg_t>& l) :
     Message(MSG_OSD_PG_REMOVE) {
     this->epoch = e;
index ad1efa3ac5943467b103d3724d223ddb7adc39a8..ad52a7f5fe78a0185bfcc812f67d54b81f0d3c91 100644 (file)
@@ -25,7 +25,7 @@ public:
 
   epoch_t get_epoch() { return epoch; }
 
-  MOSDPGTrim() {}
+  MOSDPGTrim() : Message(MSG_OSD_PG_TRIM) {}
   MOSDPGTrim(version_t mv, pg_t p, eversion_t tt) :
     Message(MSG_OSD_PG_TRIM),
     epoch(mv), pgid(p), trim_to(tt) { }
index 9956ef25ad95dfe663a9d3c9de46a08e73d1a9de..6c3d7e8b38782d5e61b438973ea143991efe9561 100644 (file)
@@ -48,7 +48,7 @@ class MOSDPing : public Message {
     Message(MSG_OSD_PING), fsid(f), map_epoch(e), peer_as_of_epoch(pe), op(o) { }
   MOSDPing(const uuid_d& f, epoch_t e, epoch_t pe, osd_peer_stat_t& ps, __u8 o=HEARTBEAT) : 
     Message(MSG_OSD_PING), fsid(f), map_epoch(e), peer_as_of_epoch(pe), op(o), peer_stat(ps) { }
-  MOSDPing() {}
+  MOSDPing() : Message(MSG_OSD_PING) {}
 private:
   ~MOSDPing() {}
 
index 522bfb22b21d99af176af389f0a35ff983c2c706..3a32ba21458025ada0bf0533b29a041f0de00fd5 100644 (file)
@@ -28,7 +28,7 @@ struct MOSDRepScrub : public Message {
   eversion_t scrub_to;   // last_update_applied when message sent
   epoch_t map_epoch;
 
-  MOSDRepScrub() {}
+  MOSDRepScrub() : Message(MSG_OSD_REP_SCRUB) {}
   MOSDRepScrub(pg_t pgid, eversion_t scrub_from, eversion_t scrub_to,
               epoch_t map_epoch) :
     Message(MSG_OSD_REP_SCRUB),
index 67633e82d14f13a7a2f1a8a377e15c8bca27668b..e4c9bd158688bc938329199e023d2a9750043d9d 100644 (file)
@@ -27,7 +27,7 @@ struct MOSDScrub : public Message {
   vector<pg_t> scrub_pgs;
   bool repair;
 
-  MOSDScrub() {}
+  MOSDScrub() : Message(MSG_OSD_SCRUB) {}
   MOSDScrub(const uuid_d& f, bool r) :
     Message(MSG_OSD_SCRUB),
     fsid(f), repair(r) {}
index 81aba7f3366dbe661a940f95732061ca31807de3..bee6a97e592c9b1497526d3deba1283edb200c73 100644 (file)
@@ -165,7 +165,7 @@ public:
     memset(&peer_stat, 0, sizeof(peer_stat));
     set_tid(rtid);
   }
-  MOSDSubOp() {}
+  MOSDSubOp() : Message(MSG_OSD_SUBOP) {}
 private:
   ~MOSDSubOp() {}
 
index aa186372bbbe45b4cf7355ad8ff877d012d2a210..fc2d7717eab72e974784138c512f1514c8fe48c4 100644 (file)
@@ -119,7 +119,7 @@ public:
     memset(&peer_stat, 0, sizeof(peer_stat));
     set_tid(req->get_tid());
   }
-  MOSDSubOpReply() {}
+  MOSDSubOpReply() : Message(MSG_OSD_SUBOPREPLY) {}
 private:
   ~MOSDSubOpReply() {}