]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: go const-crazy on messages
authorSage Weil <sage.weil@dreamhost.com>
Mon, 30 Jan 2012 21:28:44 +0000 (13:28 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 30 Jan 2012 21:28:53 +0000 (13:28 -0800)
- get_type_name()
- print()
and all the random crap they call.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
101 files changed:
src/messages/MAuth.h
src/messages/MAuthReply.h
src/messages/MCacheExpire.h
src/messages/MClientCapRelease.h
src/messages/MClientCaps.h
src/messages/MClientLease.h
src/messages/MClientReconnect.h
src/messages/MClientReply.h
src/messages/MClientRequest.h
src/messages/MClientRequestForward.h
src/messages/MClientSession.h
src/messages/MClientSnap.h
src/messages/MCommand.h
src/messages/MCommandReply.h
src/messages/MDentryLink.h
src/messages/MDentryUnlink.h
src/messages/MDirUpdate.h
src/messages/MDiscover.h
src/messages/MDiscoverReply.h
src/messages/MExportCaps.h
src/messages/MExportCapsAck.h
src/messages/MExportDir.h
src/messages/MExportDirAck.h
src/messages/MExportDirCancel.h
src/messages/MExportDirDiscover.h
src/messages/MExportDirDiscoverAck.h
src/messages/MExportDirFinish.h
src/messages/MExportDirNotify.h
src/messages/MExportDirNotifyAck.h
src/messages/MExportDirPrep.h
src/messages/MExportDirPrepAck.h
src/messages/MForward.h
src/messages/MGenericMessage.h
src/messages/MGetPoolStats.h
src/messages/MGetPoolStatsReply.h
src/messages/MHeartbeat.h
src/messages/MInodeFileCaps.h
src/messages/MLock.h
src/messages/MLog.h
src/messages/MLogAck.h
src/messages/MMDSBeacon.h
src/messages/MMDSCacheRejoin.h
src/messages/MMDSFindIno.h
src/messages/MMDSFindInoReply.h
src/messages/MMDSFragmentNotify.h
src/messages/MMDSLoadTargets.h
src/messages/MMDSMap.h
src/messages/MMDSResolve.h
src/messages/MMDSResolveAck.h
src/messages/MMDSSlaveRequest.h
src/messages/MMDSTableRequest.h
src/messages/MMonCommand.h
src/messages/MMonCommandAck.h
src/messages/MMonElection.h
src/messages/MMonGetMap.h
src/messages/MMonGetVersion.h
src/messages/MMonGetVersionReply.h
src/messages/MMonGlobalID.h
src/messages/MMonJoin.h
src/messages/MMonMap.h
src/messages/MMonObserve.h
src/messages/MMonObserveNotify.h
src/messages/MMonPaxos.h
src/messages/MMonProbe.h
src/messages/MMonSubscribe.h
src/messages/MMonSubscribeAck.h
src/messages/MOSDAlive.h
src/messages/MOSDBoot.h
src/messages/MOSDFailure.h
src/messages/MOSDMap.h
src/messages/MOSDOp.h
src/messages/MOSDOpReply.h
src/messages/MOSDPGBackfill.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/MOSDPGScan.h
src/messages/MOSDPGTemp.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
src/messages/MPGStats.h
src/messages/MPGStatsAck.h
src/messages/MPing.h
src/messages/MPoolOp.h
src/messages/MPoolOpReply.h
src/messages/MRemoveSnaps.h
src/messages/MRoute.h
src/messages/MStatfs.h
src/messages/MStatfsReply.h
src/messages/MWatchNotify.h
src/messages/PaxosServiceMessage.h
src/msg/Message.h
src/osdc/Objecter.cc

index d7922ebe35db62c43fd9cb36666d36ef751c7672..40a7fa5e3ea471ceec40f5732b28908c2a7288c0 100644 (file)
@@ -29,8 +29,8 @@ private:
   ~MAuth() {}
 
 public:
-  const char *get_type_name() { return "auth"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "auth"; }
+  void print(ostream& out) const {
     out << "auth(proto " << protocol << " " << auth_payload.length() << " bytes"
        << " epoch " << monmap_epoch << ")";
   }
index 31c1f993a356b3780adf46457da4a8bb7660d7c9..8704346dc760618928a19b843ec9687b4d3231df 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MAuthReply() {}
 
 public:
-  const char *get_type_name() { return "auth_reply"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "auth_reply"; }
+  void print(ostream& o) const {
     char buf[80];
     o << "auth_reply(proto " << protocol << " " << result << " " << strerror_r(-result, buf, sizeof(buf));
     if (result_msg.length())
index db6eda4559e151b80806c80521e0c4ff69ce44c1..c88583a1952415b3c80c742a83cd89636263d5dc 100644 (file)
@@ -53,7 +53,7 @@ private:
   ~MCacheExpire() {}
 
 public:
-  virtual const char *get_type_name() { return "cache_expire";}
+  virtual const char *get_type_name() const { return "cache_expire";}
   
   void add_inode(dirfrag_t r, vinodeno_t vino, int nonce) {
     realms[r].inodes[vino] = nonce;
index 1843b1849a40b3fc8086074f23afc84f2ad1c1ca..5258c5d970f7b3848640cdb46db58aa9db302e61 100644 (file)
@@ -31,8 +31,8 @@ private:
   ~MClientCapRelease() {}
 
 public:
-  const char *get_type_name() { return "client_cap_release";}
-  void print(ostream& out) {
+  const char *get_type_name() const { return "client_cap_release";}
+  void print(ostream& out) const {
     out << "client_cap_release(" << head.num << ")";
   }
   
index 3aecfe2b235b2544427f6ec85494cb182184a8ed..d515304f93e6f88b01ce5109f8051217c085d0a5 100644 (file)
@@ -106,8 +106,8 @@ private:
   ~MClientCaps() {}
 
 public:
-  const char *get_type_name() { return "Cfcap";}
-  void print(ostream& out) {
+  const char *get_type_name() const { return "Cfcap";}
+  void print(ostream& out) const {
     out << "client_caps(" << ceph_cap_op_name(head.op)
        << " ino " << inodeno_t(head.ino)
        << " " << head.cap_id
index 0470ad9f67a596186db9a12579bf5ff655f9ae63..2b80c2ad234ec254d55e848ec88805b7db29bc39 100644 (file)
@@ -22,12 +22,12 @@ struct MClientLease : public Message {
   struct ceph_mds_lease h;
   string dname;
   
-  int get_action() { return h.action; }
-  ceph_seq_t get_seq() { return h.seq; }
-  int get_mask() { return h.mask; }
-  inodeno_t get_ino() { return inodeno_t(h.ino); }
-  snapid_t get_first() { return snapid_t(h.first); }
-  snapid_t get_last() { return snapid_t(h.last); }
+  int get_action() const { return h.action; }
+  ceph_seq_t get_seq() const { return h.seq; }
+  int get_mask() const { return h.mask; }
+  inodeno_t get_ino() const { return inodeno_t(h.ino); }
+  snapid_t get_first() const { return snapid_t(h.first); }
+  snapid_t get_last() const { return snapid_t(h.last); }
 
   MClientLease() : Message(CEPH_MSG_CLIENT_LEASE) {}
   MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl) :
@@ -55,8 +55,8 @@ private:
   ~MClientLease() {}
 
 public:
-  const char *get_type_name() { return "client_lease"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "client_lease"; }
+  void print(ostream& out) const {
     out << "client_lease(a=" << ceph_lease_op_name(get_action())
        << " seq " << get_seq()
        << " mask " << get_mask();
index 175aff0b1b19cefd016482ccc5b0e13b100eba55..aef97ee46df6aa06956bcee29c36059d8786ca05 100644 (file)
@@ -30,8 +30,8 @@ private:
   ~MClientReconnect() {}
 
 public:
-  const char *get_type_name() { return "client_reconnect"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "client_reconnect"; }
+  void print(ostream& out) const {
     out << "client_reconnect("
        << caps.size() << " caps)";
   }
index 05d96cb367596ce325264a4340589e931fd4280d..ee3dbb92a4fb6dd6fbf07e2565fc638f39ceb01c 100644 (file)
@@ -186,18 +186,18 @@ public:
   bufferlist snapbl;
 
  public:
-  int get_op() { return head.op; }
+  int get_op() const { return head.op; }
 
   void set_mdsmap_epoch(epoch_t e) { head.mdsmap_epoch = e; }
-  epoch_t get_mdsmap_epoch() { return head.mdsmap_epoch; }
+  epoch_t get_mdsmap_epoch() const { return head.mdsmap_epoch; }
 
-  int get_result() { return (__s32)(__u32)head.result; }
+  int get_result() const { return (__s32)(__u32)head.result; }
 
   void set_result(int r) { head.result = r; }
 
   void set_unsafe() { head.safe = 0; }
 
-  bool is_safe() { return head.safe; }
+  bool is_safe() const { return head.safe; }
 
   MClientReply() {}
   MClientReply(MClientRequest *req, int result = 0) : 
@@ -212,8 +212,8 @@ private:
   ~MClientReply() {}
 
 public:
-  const char *get_type_name() { return "creply"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "creply"; }
+  void print(ostream& o) const {
     o << "client_reply(???:" << get_tid();
     o << " = " << get_result();
     if (get_result() <= 0) {
index 2e27382a73994bb696697dd18d66995546bf1bb6..4e61fa48c35bc7d42c40fae528f4f429965800cc 100644 (file)
@@ -104,7 +104,7 @@ public:
       (head.op == CEPH_MDS_OP_CREATE);
   }
 
-  int get_flags() {
+  int get_flags() const {
     return head.flags;
   }
   bool is_replay() {
@@ -127,17 +127,17 @@ public:
     head.flags = head.flags | CEPH_MDS_FLAG_REPLAY;
   }
     
-  tid_t get_oldest_client_tid() { return head.oldest_client_tid; }
-  int get_num_fwd() { return head.num_fwd; }
-  int get_retry_attempt() { return head.num_retry; }
-  int get_op() { return head.op; }
-  unsigned get_caller_uid() { return head.caller_uid; }
-  unsigned get_caller_gid() { return head.caller_gid; }
-
-  const string& get_path() { return path.get_path(); }
-  filepath& get_filepath() { return path; }
-  const string& get_path2() { return path2.get_path(); }
-  filepath& get_filepath2() { return path2; }
+  tid_t get_oldest_client_tid() const { return head.oldest_client_tid; }
+  int get_num_fwd() const { return head.num_fwd; }
+  int get_retry_attempt() const { return head.num_retry; }
+  int get_op() const { return head.op; }
+  unsigned get_caller_uid() const { return head.caller_uid; }
+  unsigned get_caller_gid() const { return head.caller_gid; }
+
+  const string& get_path() const { return path.get_path(); }
+  const filepath& get_filepath() const { return path; }
+  const string& get_path2() const { return path2.get_path(); }
+  const filepath& get_filepath2() const { return path2; }
 
   int get_dentry_wanted() { return get_flags() & CEPH_MDS_FLAG_WANT_DENTRY; }
 
@@ -157,8 +157,8 @@ public:
     ::encode_nohead(releases, payload);
   }
 
-  const char *get_type_name() { return "creq"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "creq"; }
+  void print(ostream& out) const {
     out << "client_request(" << get_orig_source() 
        << ":" << get_tid() 
        << " " << ceph_mds_op_name(get_op());
index 814534cc6da92dcc4a4212610d558382d8adf032..c212a4a30e99924721da554a113339429623f9d1 100644 (file)
@@ -37,8 +37,8 @@ public:
   int get_num_fwd() { return num_fwd; }
   bool must_resend() { return client_must_resend; }
 
-  const char *get_type_name() { return "client_request_forward"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "client_request_forward"; }
+  void print(ostream& o) const {
     o << "client_request_forward(" << get_tid()
       << " to mds." << dest_mds
       << " num_fwd=" << num_fwd
index cd516495c67317234217a0b3681bb0530fe50107..4b98a983b0f1bd8ca84ee8ed2c9011cf74fd9fd1 100644 (file)
@@ -21,11 +21,11 @@ class MClientSession : public Message {
 public:
   ceph_mds_session_head head;
 
-  int get_op() { return head.op; }
-  version_t get_seq() { return head.seq; }
-  utime_t get_stamp() { return utime_t(head.stamp); }
-  int get_max_caps() { return head.max_caps; }
-  int get_max_leases() { return head.max_leases; }
+  int get_op() const { return head.op; }
+  version_t get_seq() const { return head.seq; }
+  utime_t get_stamp() const { return utime_t(head.stamp); }
+  int get_max_caps() const { return head.max_caps; }
+  int get_max_leases() const { return head.max_leases; }
 
   MClientSession() : Message(CEPH_MSG_CLIENT_SESSION) { }
   MClientSession(int o, version_t s=0) : 
@@ -45,8 +45,8 @@ private:
   ~MClientSession() {}
 
 public:
-  const char *get_type_name() { return "client_session"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "client_session"; }
+  void print(ostream& out) const {
     out << "client_session(" << ceph_session_op_name(get_op());
     if (get_seq())
       out << " seq " << get_seq();
index d7d0383d6a9f8e94528b11e55eb6b28e2eb79802..7f7283e3405ed4a6e7e7f2e9edcf826acf915c17 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MClientSnap() {}
 
 public:  
-  const char *get_type_name() { return "client_snap"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "client_snap"; }
+  void print(ostream& out) const {
     out << "client_snap(" << ceph_snap_op_name(head.op);
     if (head.split)
       out << " split=" << inodeno_t(head.split);
index 4d2af0473b55870d96a4fe86946c5fb414b889f0..e2fe0752f34f686f7d8f67ae69c5b744b697c107 100644 (file)
@@ -35,8 +35,8 @@ private:
   ~MCommand() {}
 
 public:  
-  const char *get_type_name() { return "command"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "command"; }
+  void print(ostream& o) const {
     o << "command(tid " << get_tid() << ": ";
     for (unsigned i=0; i<cmd.size(); i++) {
       if (i) o << ' ';
index 701d854daaa74b13d03d6260e939b781483f97da..eda184f4ce003c8c6a113a520b21358b2b366cf2 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MCommandReply() {}
 
 public:
-  const char *get_type_name() { return "command_reply"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "command_reply"; }
+  void print(ostream& o) const {
     o << "command_reply(tid " << get_tid() << ": " << r << " " << rs << ")";
   }
   
index 2b89a4e60d3ee381da6cb4705b5eda66ac212923..ed02bc20e6bfed5015752107133d2041d957b569 100644 (file)
@@ -39,8 +39,8 @@ private:
   ~MDentryLink() {}
 
 public:
-  const char *get_type_name() { return "dentry_link";}
-  void print(ostream& o) {
+  const char *get_type_name() const { return "dentry_link";}
+  void print(ostream& o) const {
     o << "dentry_link(" << dirfrag << " " << dn << ")";
   }
   
index ca0ce3542844e6ccf3af56cc4d3e4d76399e1556..1cae33fbb83e93d49f01f175b70c867c0d7ff7ac 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MDentryUnlink() {}
 
 public:
-  const char *get_type_name() { return "dentry_unlink";}
-  void print(ostream& o) {
+  const char *get_type_name() const { return "dentry_unlink";}
+  void print(ostream& o) const {
     o << "dentry_unlink(" << dirfrag << " " << dn << ")";
   }
   
index cbe1031e0a666988eb95dd2a07df1980d8b33a88..e9914c235c7370111dcc78ba9bcab8843d391d04 100644 (file)
@@ -27,12 +27,12 @@ class MDirUpdate : public Message {
   filepath path;
 
  public:
-  int get_source_mds() { return from_mds; }
-  dirfrag_t get_dirfrag() { return dirfrag; }
-  int get_dir_rep() { return dir_rep; }
-  set<int>& get_dir_rep_by() { return dir_rep_by; } 
-  bool should_discover() { return discover > 0; }
-  filepath& get_path() { return path; }
+  int get_source_mds() const { return from_mds; }
+  dirfrag_t get_dirfrag() const { return dirfrag; }
+  int get_dir_rep() const { return dir_rep; }
+  const set<int>& get_dir_rep_by() const { return dir_rep_by; } 
+  bool should_discover() const { return discover > 0; }
+  const filepath& get_path() const { return path; }
 
   void tried_discover() {
     if (discover) discover--;
@@ -57,8 +57,8 @@ private:
   ~MDirUpdate() {}
 
 public:
-  const char *get_type_name() { return "dir_update"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "dir_update"; }
+  void print(ostream& out) const {
     out << "dir_update(" << get_dirfrag() << ")";
   }
 
index b993c82eea09ce16b682e5bc534b4cf8ad8eb0c1..937b51ec92f04104346fa64cd756de40d0106668 100644 (file)
@@ -69,8 +69,8 @@ private:
   ~MDiscover() {}
 
 public:
-  const char *get_type_name() { return "Dis"; }
-  void print(ostream &out) {
+  const char *get_type_name() const { return "Dis"; }
+  void print(ostream &out) const {
     out << "discover(" << header.tid << " " << base_ino << "." << base_dir_frag
        << " " << want;
     if (want_ino)
index 4d3c60e5505457758da536b0ba50d9fd99b30262..0b424157a68e9b696d985a39a01245a4c040b210 100644 (file)
@@ -146,8 +146,8 @@ private:
   ~MDiscoverReply() {}
 
 public:
-  const char *get_type_name() { return "discover_reply"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "discover_reply"; }
+  void print(ostream& out) const {
     out << "discover_reply(" << header.tid << " " << base_ino << ")";
   }
   
index 167af27cbe45946ad29faf75bb385af866b366de..dcb2298eebb3e8c3385fdf7b97096f52abd8eb78 100644 (file)
@@ -31,8 +31,8 @@ private:
   ~MExportCaps() {}
 
 public:
-  const char *get_type_name() { return "export_caps"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "export_caps"; }
+  void print(ostream& o) const {
     o << "export_caps(" << ino << ")";
   }
 
index 623fb2b7a145fe8e8c54de8f85e5421c727bc5b1..b8fcf1fa9caa1901502d75ad264438d3eb9abfeb 100644 (file)
@@ -31,8 +31,8 @@ private:
   ~MExportCapsAck() {}
 
 public:
-  const char *get_type_name() { return "export_caps_ack"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "export_caps_ack"; }
+  void print(ostream& o) const {
     o << "export_caps_ack(" << ino << ")";
   }
 
index c8542985a20598f8dcd524eace461d458d6b13b0..4f74e7a926ee12e91eb3d8ebb0ee033e3e9e9b06 100644 (file)
@@ -35,8 +35,8 @@ private:
   ~MExportDir() {}
 
 public:
-  const char *get_type_name() { return "Ex"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "Ex"; }
+  void print(ostream& o) const {
     o << "export(" << dirfrag << ")";
   }
 
index 13ff47d21e1fb61ae791d3812114c6745d83cdde..8ad79d9f96189f62300759c20a235666a2dab6e6 100644 (file)
@@ -30,8 +30,8 @@ private:
   ~MExportDirAck() {}
 
 public:
-  const char *get_type_name() { return "ExAck"; }
-    void print(ostream& o) {
+  const char *get_type_name() const { return "ExAck"; }
+    void print(ostream& o) const {
     o << "export_ack(" << dirfrag << ")";
   }
 
index e87775436cef4058bb77c284c6005401f5742ab9..52f7b124fa94e3fca99628f7ed5dc8a68b0b4057 100644 (file)
@@ -32,8 +32,8 @@ private:
   ~MExportDirCancel() {}
 
 public:
-  const char *get_type_name() { return "ExCancel"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExCancel"; }
+  void print(ostream& o) const {
     o << "export_cancel(" << dirfrag << ")";
   }
 
index e8276f97ba0dffa8058fc100e2975b9b24eaa0a1..7602bd91ee970aca290d4d7de13b65084eeec01e 100644 (file)
@@ -45,8 +45,8 @@ private:
   ~MExportDirDiscover() {}
 
 public:
-  const char *get_type_name() { return "ExDis"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExDis"; }
+  void print(ostream& o) const {
     o << "export_discover(" << dirfrag << " " << path << ")";
   }
 
index 79cd6c74fe02b2a83a3403215d60d3dc3b430191..2aafc7400b8b8ae964265ba5f23e3a43e644eeb1 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MExportDirDiscoverAck() {}
 
 public:
-  const char *get_type_name() { return "ExDisA"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExDisA"; }
+  void print(ostream& o) const {
     o << "export_discover_ack(" << dirfrag;
     if (success) 
       o << " success)";
index b97902de93223c6bd090729d69eacf860b72b3bd..6d05885f3e0bd50eeaeef7e5b8672e32991523d4 100644 (file)
@@ -32,8 +32,8 @@ private:
   ~MExportDirFinish() {}
 
 public:
-  const char *get_type_name() { return "ExFin"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExFin"; }
+  void print(ostream& o) const {
     o << "export_finish(" << dirfrag << ")";
   }
   
index 4b141ba1144f0bc2a2021641b6537ffa0db9c31f..a209901d48b4256dd6a282874b333ef4dc02ad05 100644 (file)
@@ -40,8 +40,8 @@ private:
   ~MExportDirNotify() {}
 
 public:
-  const char *get_type_name() { return "ExNot"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExNot"; }
+  void print(ostream& o) const {
     o << "export_notify(" << base;
     o << " " << old_auth << " -> " << new_auth;
     if (ack) 
index a3d91366ddf7678c97f8a0b5f2c3078067897f84..35a6956185be85187de01683fb27bf5f9d5a1bbd 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MExportDirNotifyAck() {}
 
 public:
-  const char *get_type_name() { return "ExNotA"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExNotA"; }
+  void print(ostream& o) const {
     o << "export_notify_ack(" << dirfrag << ")";
   }
 
index c45236d20d533b8cfb3e3346d58072fea5223473..12f358ece037c6346d835d230288778b38f831b1 100644 (file)
@@ -48,8 +48,8 @@ private:
   ~MExportDirPrep() {}
 
 public:
-  const char *get_type_name() { return "ExP"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExP"; }
+  void print(ostream& o) const {
     o << "export_prep(" << dirfrag << ")";
   }
 
index 0593fc5aa73eba9b43e7407bd809018c30612047..b5d180d5765bf4c436857ea3c9a7a5802bcdfa2b 100644 (file)
@@ -32,8 +32,8 @@ private:
   ~MExportDirPrepAck() {}
 
 public:  
-  const char *get_type_name() { return "ExPAck"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "ExPAck"; }
+  void print(ostream& o) const {
     o << "export_prep_ack(" << dirfrag << ")";
   }
 
index 77f71b5086d9a03e151ee4d7ceed07d0006c5c9f..34a800408f2d9624d090d62f06d05461f6b4edfa 100644 (file)
@@ -61,8 +61,8 @@ public:
     msg = (PaxosServiceMessage *)decode_message(NULL, p);
   }
 
-  const char *get_type_name() { return "forward"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "forward"; }
+  void print(ostream& o) const {
     if (msg)
       o << "forward(" << *msg << ") to leader";
     else o << "forward(??? ) to leader";
index 13ce98eb6e4d3f849bade8c618674873aed96ee0..e042bef00c8b1a73b509b5b3048a4446e894419a 100644 (file)
@@ -30,7 +30,7 @@ class MGenericMessage : public Message {
   //void set_pcid(long pcid) { this->pcid = pcid; }
   //long get_pcid() { return pcid; }
 
-  const char *get_type_name() { return tname; }
+  const char *get_type_name() const { return tname; }
 
   void decode_payload() { }
   void encode_payload(uint64_t features) { }
index c773487a58eca3a78537a8354b82630ed3092551..acf9637e4c516ec8eaa8decb5bd719c17bd25cbf 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MGetPoolStats() {}
 
 public:
-  const char *get_type_name() { return "getpoolstats"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "getpoolstats"; }
+  void print(ostream& out) const {
     out << "getpoolstats(" << get_tid() << " " << pools << " v" << version << ")";
   }
 
index 2cda83d16d74e5b99f944c100e157f4cf584719c..26f9e13ab7083e48d2df8690cb7ae3a0efcfd6b0 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MGetPoolStatsReply() {}
 
 public:
-  const char *get_type_name() { return "getpoolstats"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "getpoolstats"; }
+  void print(ostream& out) const {
     out << "getpoolstatsreply(" << get_tid() << " v" << version <<  ")";
   }
 
index 848509fd1c298363cd49a8a31e768f2e9aaa3fc2..bddffc0b001401945aad44d4cdd2543c00e5f8ca 100644 (file)
@@ -46,7 +46,7 @@ private:
   ~MHeartbeat() {}
 
 public:
-  const char *get_type_name() { return "HB"; }
+  const char *get_type_name() const { return "HB"; }
 
   void encode_payload(uint64_t features) {
     ::encode(load, payload);
index 5399598f6ad6db7957bfa08facfddc12ef6fa73f..b5fc0ddd3461a6a5684f379630b7639cdeb75c6f 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MInodeFileCaps() {}
 
 public:
-  const char *get_type_name() { return "inode_file_caps";}
-  void print(ostream& out) {
+  const char *get_type_name() const { return "inode_file_caps";}
+  void print(ostream& out) const {
     out << "inode_file_caps(" << ino << " " << ccap_string(caps) << ")";
   }
   
index 3bda13f8ac56ef88da8d8379b8d9c77b0e21fa28..0d66a001e24e224ced24856f3b65e4be64cf2d0e 100644 (file)
@@ -59,8 +59,8 @@ private:
   ~MLock() {}
   
 public:
-  const char *get_type_name() { return "ILock"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "ILock"; }
+  void print(ostream& out) const {
     out << "lock(a=" << get_lock_action_name(action)
        << " " << get_lock_type_name(lock_type)
        << " " << object_info
index 3c4dfc94f85b681bd2eeca7b233dcf4a171fdc9e..61ca18b6944857053b48636407b63f0eac45d2de 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MLog() {}
 
 public:
-  const char *get_type_name() { return "log"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "log"; }
+  void print(ostream& out) const {
     out << "log(";
     if (entries.size())
       out << entries.size() << " entries";
index f1ce5246fd36f726cc21735955552fdfba9b0803..8022e7ced572b64a43e966cc3fa562b94b46ceec 100644 (file)
@@ -28,8 +28,8 @@ private:
   ~MLogAck() {}
 
 public:
-  const char *get_type_name() { return "log_ack"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "log_ack"; }
+  void print(ostream& out) const {
     out << "log(last " << last << ")";
   }
 
index c77a27aaf9af51c266588100508e5dbdadf19a9c..e1c950d250b5fae81bdc0358341ed26e05f1c7eb 100644 (file)
@@ -51,7 +51,7 @@ public:
   epoch_t get_last_epoch_seen() { return version; }
   int get_state() { return state; }
   version_t get_seq() { return seq; }
-  const char *get_type_name() { return "mdsbeacon"; }
+  const char *get_type_name() const { return "mdsbeacon"; }
   int get_standby_for_rank() { return standby_for_rank; }
   const string& get_standby_for_name() { return standby_for_name; }
 
@@ -62,7 +62,7 @@ public:
   void set_standby_for_name(string& n) { standby_for_name = n; }
   void set_standby_for_name(const char* c) { standby_for_name.assign(c); }
 
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "mdsbeacon(" << global_id << "/" << name << " " << ceph_mds_state_name(state) 
        << " seq " << seq << " v" << version << ")";
   }
index 0052b3e5c63cc65b9b8c3eecd99d005e957478eb..e5a86ee45cb0c75a86982c52efe9deacf97371cb 100644 (file)
@@ -196,8 +196,8 @@ private:
   ~MMDSCacheRejoin() {}
 
 public:
-  const char *get_type_name() { return "cache_rejoin"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "cache_rejoin"; }
+  void print(ostream& out) const {
     out << "cache_rejoin " << get_opname(op);
   }
 
index 3e291de059130d35d6ef5291354e4929c5bfcca1..d8eddcb49b841e851a08b4c7f750580ac79a15b5 100644 (file)
@@ -25,8 +25,8 @@ struct MMDSFindIno : public Message {
   MMDSFindIno() : Message(MSG_MDS_FINDINO) {}
   MMDSFindIno(tid_t t, inodeno_t i) : Message(MSG_MDS_FINDINO), tid(t), ino(i) {}
 
-  const char *get_type_name() { return "findino"; }
-  void print(ostream &out) {
+  const char *get_type_name() const { return "findino"; }
+  void print(ostream &out) const {
     out << "findino(" << tid << " " << ino << ")";
   }
 
index 64b48cae6c1a962a1bffe35a9dd6fb98d71c9867..3d6ec6c6ce6b57553a447e93cf90ee7a4d83f0d1 100644 (file)
@@ -25,8 +25,8 @@ struct MMDSFindInoReply : public Message {
   MMDSFindInoReply() : Message(MSG_MDS_FINDINOREPLY) {}
   MMDSFindInoReply(tid_t t) : Message(MSG_MDS_FINDINOREPLY), tid(t) {}
 
-  const char *get_type_name() { return "findinoreply"; }
-  void print(ostream &out) {
+  const char *get_type_name() const { return "findinoreply"; }
+  void print(ostream &out) const {
     out << "findinoreply(" << tid << " " << path << ")";
   }
   
index 922f0093c80dbb9156f45a662c5f773c8f097891..10eb0c7d4029dc1fe8f2596dc160ba1394ed8eb4 100644 (file)
@@ -39,8 +39,8 @@ private:
   ~MMDSFragmentNotify() {}
 
 public:  
-  const char *get_type_name() { return "fragment_notify"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "fragment_notify"; }
+  void print(ostream& o) const {
     o << "fragment_notify(" << ino << "." << basefrag
       << " " << (int)bits << ")";
   }
index 0aeb6b63b5d34fb625d082fc7cf3cd883845ecf0..4022f32e36b3a419a7635d3ad9325ab916ddddf8 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MMDSLoadTargets() {}
 
 public:
-  const char* get_type_name() { return "mds_load_targets"; }
-  void print(ostream& o) {
+  const char* get_type_name() const { return "mds_load_targets"; }
+  void print(ostream& o) const {
     o << "mds_load_targets(" << global_id << " " << targets << ")";
   }
 
index ae6ed9a34d053858aff19631400cdd8ee9c1145a..b5558493746c590982734745010c5146c1e78907 100644 (file)
@@ -67,8 +67,8 @@ private:
   ~MMDSMap() {}
 
 public:
-  const char *get_type_name() { return "mdsmap"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "mdsmap"; }
+  void print(ostream& out) const {
     out << "mdsmap(e " << epoch << ")";
   }
 
index 9b929ef68f98acc4d37f8178e2e69daf13f41143..551ca991a479e24c340da302b3dece0a541dc62c 100644 (file)
@@ -30,9 +30,9 @@ private:
   ~MMDSResolve() {}
 
 public:
-  const char *get_type_name() { return "mds_resolve"; }
+  const char *get_type_name() const { return "mds_resolve"; }
 
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "mds_resolve(" << subtrees.size()
        << "+" << ambiguous_imports.size()
        << " subtrees +" << slave_requests.size() << " slave requests)";
index 9fcee3e0b4fa94add6ef257490c861d31293138a..2118abaaf49952b2c536131531cace270ce1bb44 100644 (file)
@@ -30,8 +30,8 @@ private:
   ~MMDSResolveAck() {}
 
 public:
-  const char *get_type_name() { return "resolve_ack"; }
-  /*void print(ostream& out) {
+  const char *get_type_name() const { return "resolve_ack"; }
+  /*void print(ostream& out) const {
     out << "resolve_ack.size()
        << "+" << ambiguous_imap.size()
        << " imports +" << slave_requests.size() << " slave requests)";
index 628374eed702af1bd683794c76370f71db4dc16f..4f2bb5948bdf7f9c192fa4fd35715ebb58d64a73 100644 (file)
@@ -161,8 +161,8 @@ public:
     ::decode(stray, p);
   }
 
-  const char *get_type_name() { return "slave_request"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "slave_request"; }
+  void print(ostream& out) const {
     out << "slave_request(" << reqid
        << "." << attempt
        << " " << get_opname(op) 
index 3ce95173fa9c3aed18049a80a2c750806b423e6c..fcbfcb8638e323f66bdfbbbdd9992a50227c4bf1 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MMDSTableRequest() {}
 
 public:  
-  virtual const char *get_type_name() { return "mds_table_request"; }
-  void print(ostream& o) {
+  virtual const char *get_type_name() const { return "mds_table_request"; }
+  void print(ostream& o) const {
     o << "mds_table_request(" << get_mdstable_name(table)
       << " " << get_mdstableserver_opname(op);
     if (reqid) o << " " << reqid;
index 26629d72067014c03cffe42c132a1ff20f5be5d5..c011596ad52aeeb2a9ed8f70f45374107a18c520 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MMonCommand() {}
 
 public:  
-  const char *get_type_name() { return "mon_command"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_command"; }
+  void print(ostream& o) const {
     o << "mon_command(";
     for (unsigned i=0; i<cmd.size(); i++) {
       if (i) o << ' ';
index 3f7bcbcf713a6ce284748bd134ee53afcefa5390..bd3d62da54cf8eef7119863fb87f76df5b17480e 100644 (file)
@@ -31,8 +31,8 @@ private:
   ~MMonCommandAck() {}
 
 public:
-  const char *get_type_name() { return "mon_command"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_command"; }
+  void print(ostream& o) const {
     o << "mon_command_ack(" << cmd << "=" << r << " " << rs << " v" << version << ")";
   }
   
index 2d1472af59fcd47f6dc4a61b23c0504de32705de..26defa279d63b2952aedc544ebd1c2d684a1a230 100644 (file)
@@ -51,8 +51,8 @@ private:
   ~MMonElection() {}
 
 public:  
-  const char *get_type_name() { return "election"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "election"; }
+  void print(ostream& out) const {
     out << "election(" << fsid << " " << get_opname(op) << " " << epoch << ")";
   }
   
index 65cec30d5bb08f07c3149dfb73a34146c3d6dd45..d4bb61e751d9c6ba8c84116f817121b143238a27 100644 (file)
@@ -26,7 +26,7 @@ private:
   ~MMonGetMap() {}
 
 public:
-  const char *get_type_name() { return "mon_getmap"; }
+  const char *get_type_name() const { return "mon_getmap"; }
   
   void encode_payload(uint64_t features) { }
   void decode_payload() { }
index 67a0285793ba10ec536ed3bcb7c1ae18427a8d22..14c648184769d4601d864a23e55e0d42648a36a8 100644 (file)
@@ -29,11 +29,11 @@ class MMonGetVersion : public Message {
 public:
   MMonGetVersion() : Message(CEPH_MSG_MON_GET_VERSION) {}
 
-  const char *get_type_name() {
+  const char *get_type_name() const {
     return "mon_get_version";
   }
 
-  void print(ostream& o) {
+  void print(ostream& o) const {
     o << "mon_get_version(what=" << what << " handle=" << handle << ")";
   }
 
index d954aea5fbae2ea9a45a6be7f1938b8c42132490..2451cbeefc26d8e10ad09ae6b403c1a11090ee66 100644 (file)
@@ -28,11 +28,11 @@ class MMonGetVersionReply : public Message {
 public:
   MMonGetVersionReply() : Message(CEPH_MSG_MON_GET_VERSION_REPLY) {}
 
-  const char *get_type_name() {
+  const char *get_type_name() const {
     return "mon_check_map_ack";
   }
 
-  void print(ostream& o) {
+  void print(ostream& o) const {
     o << "mon_check_map_ack(handle=" << handle << " version=" << version << ")";
   }
 
index d9c0aa27baf42451cc86b97c5d70068b740d036e..7ec1acc9ad7782ef2c81c943850309140ed39f76 100644 (file)
@@ -24,8 +24,8 @@ private:
   ~MMonGlobalID() {}
 
 public:
-  const char *get_type_name() { return "global_id"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "global_id"; }
+  void print(ostream& out) const {
     out << "global_id  (" << old_max_id << ")";
   }
 
index 30328297c84b186ab1ee095df08b47e175ae67a7..c77bf35553c558c10720bb9e9056b4ba0e120925 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MMonJoin() {}
 
 public:  
-  const char *get_type_name() { return "mon_join"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_join"; }
+  void print(ostream& o) const {
     o << "mon_join(" << name << " " << addr << ")";
   }
   
index 5e2cc229a74ee2ab7e73f00516daf0d1d01dc77a..a314594752f291aa2225c7a8d340b1258b670cc9 100644 (file)
@@ -29,7 +29,7 @@ private:
   ~MMonMap() {}
 
 public:
-  const char *get_type_name() { return "mon_map"; }
+  const char *get_type_name() const { return "mon_map"; }
 
   void encode_payload(uint64_t features) { 
     ::encode(monmapbl, payload);
index 45049b7c46cd1a4a71eb028a96ba9791ef2a6f5d..1228129c16fecca499c9a79b03973ac052785a0f 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MMonObserve() {}
   
 public:
-  const char *get_type_name() { return "mon_observe"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_observe"; }
+  void print(ostream& o) const {
     o << "observe(" << machine_id << " v" << ver << ")";
   }
   
index bc1998e5c6f4034f8e844556864a1812d9b16072..794cf141d7b620f6e38960a63e70ec476ab7798d 100644 (file)
@@ -32,8 +32,8 @@ private:
   ~MMonObserveNotify() {}
 
 public:  
-  const char *get_type_name() { return "mon_observe_notify"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_observe_notify"; }
+  void print(ostream& o) const {
     o << "mon_observe_notify(v" << ver << " " << bl.length() << " bytes";
     if (is_latest)
       o << " latest";
index 33653c3c94851d153a97772320563ccb8ca70efc..66f7a645bd6cfbb517c5ab75d8753409c3515f32 100644 (file)
@@ -73,9 +73,9 @@ private:
   ~MMonPaxos() {}
 
 public:  
-  const char *get_type_name() { return "paxos"; }
+  const char *get_type_name() const { return "paxos"; }
   
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "paxos(" << get_paxos_name(machine_id)
        << " " << get_opname(op) 
        << " lc " << last_committed
index 30ab98987fef0f11a0d4eeeff544b8dbaca9fec6..62c1a1655e721f533eea7ce157fb360fbbee7c2b 100644 (file)
@@ -60,8 +60,8 @@ private:
   ~MMonProbe() {}
 
 public:  
-  const char *get_type_name() { return "mon_probe"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "mon_probe"; }
+  void print(ostream& out) const {
     out << "mon_probe(" << get_opname(op) << " " << fsid << " name " << name;
     if (quorum.size())
       out << " quorum " << quorum;
index 647f4041c1d3a42e46a3f20788165cdaffb44aa5..c2c1636be0ee00b1f0df1f64cdf944de5a0e5eb1 100644 (file)
@@ -42,8 +42,8 @@ public:
     what[w].flags = flags;
   }
 
-  const char *get_type_name() { return "mon_subscribe"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_subscribe"; }
+  void print(ostream& o) const {
     o << "mon_subscribe(" << what << ")";
   }
 
index 6fe71772d0a1cbda7c7fefa9b9f2672d032594f9..a2a1cded76805f229ee302ecc39216ddce9f827e 100644 (file)
@@ -31,8 +31,8 @@ private:
   ~MMonSubscribeAck() {}
 
 public:
-  const char *get_type_name() { return "mon_subscribe_ack"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "mon_subscribe_ack"; }
+  void print(ostream& o) const {
     o << "mon_subscribe_ack(" << interval << "s)";
   }
 
index 937b2274faa9ec8772eb593626744e0b4c08e285..12bbed351ac3611cc6270e98ec626bb52e4acd78 100644 (file)
@@ -39,8 +39,8 @@ public:
     ::decode(want, p);
   }
 
-  const char *get_type_name() { return "osd_alive"; }
-  void print(ostream &out) {
+  const char *get_type_name() const { return "osd_alive"; }
+  void print(ostream &out) const {
     out << "osd_alive(want up_thru " << want << " have " << version << ")";
   }
   
index 30643c478c10c15a4c6c9326137bbf29b6f44b39..2737e0da22100423f8d1943e3d1be0e647e78853 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MOSDBoot() { }
 
 public:
-  const char *get_type_name() { return "osd_boot"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "osd_boot"; }
+  void print(ostream& out) const {
     out << "osd_boot(osd." << sb.whoami << " v" << version << ")";
   }
   
index 7a86b809bfc53c0ba5d90ceba193439a0b300d21..90c20a3167e0508dd0588c9769b3ce5ac53a4196 100644 (file)
@@ -57,8 +57,8 @@ public:
     ::encode(is_failed, payload);
   }
 
-  const char *get_type_name() { return "osd_failure"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "osd_failure"; }
+  void print(ostream& out) const {
     out << "osd_failure(" << target_osd << " e" << epoch << " v" << version << ")";
   }
 };
index 5ac17b6451e90d400576bce0b6d9ada2adcb4324..cea74f12fc339dab922c32cc9d9d55b9cb9b5563 100644 (file)
@@ -27,18 +27,18 @@ class MOSDMap : public Message {
   map<epoch_t, bufferlist> incremental_maps;
   epoch_t oldest_map, newest_map;
 
-  epoch_t get_first() {
+  epoch_t get_first() const {
     epoch_t e = 0;
-    map<epoch_t, bufferlist>::iterator i = maps.begin();
+    map<epoch_t, bufferlist>::const_iterator i = maps.begin();
     if (i != maps.end())  e = i->first;
     i = incremental_maps.begin();    
     if (i != incremental_maps.end() &&
         (e == 0 || i->first < e)) e = i->first;
     return e;
   }
-  epoch_t get_last() {
+  epoch_t get_last() const {
     epoch_t e = 0;
-    map<epoch_t, bufferlist>::reverse_iterator i = maps.rbegin();
+    map<epoch_t, bufferlist>::const_reverse_iterator i = maps.rbegin();
     if (i != maps.rend())  e = i->first;
     i = incremental_maps.rbegin();    
     if (i != incremental_maps.rend() &&
@@ -123,8 +123,8 @@ public:
     }
   }
 
-  const char *get_type_name() { return "omap"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "omap"; }
+  void print(ostream& out) const {
     out << "osd_map(" << get_first() << ".." << get_last();
     if (oldest_map || newest_map)
       out << " src has " << oldest_map << ".." << newest_map;
index b08ef5fc5a6a92072b97402dd048ec47258963ed..1bca186f1acf24fe9f1f45bef3a0c81a9eebc825 100644 (file)
@@ -60,13 +60,18 @@ public:
   snapid_t get_snapid() { return snapid; }
   void set_snapid(snapid_t s) { snapid = s; }
   // writ
-  snapid_t get_snap_seq() { return snap_seq; }
-  vector<snapid_t> &get_snaps() { return snaps; }
+  snapid_t get_snap_seq() const { return snap_seq; }
+  const vector<snapid_t> &get_snaps() const { return snaps; }
+  void set_snaps(const vector<snapid_t>& i) {
+    snaps = i;
+  }
   void set_snap_seq(snapid_t s) { snap_seq = s; }
 
-  osd_reqid_t get_reqid() { return osd_reqid_t(get_orig_source(),
-                                              client_inc,
-                                              header.tid); }
+  osd_reqid_t get_reqid() const {
+    return osd_reqid_t(get_orig_source(),
+                      client_inc,
+                      header.tid);
+  }
   int get_client_inc() { return client_inc; }
   tid_t get_client_tid() { return header.tid; }
   
@@ -358,8 +363,8 @@ struct ceph_osd_request_head {
   }
 
 
-  const char *get_type_name() { return "osd_op"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "osd_op"; }
+  void print(ostream& out) const {
     out << "osd_op(" << get_reqid();
     out << " " << oid;
 
index 17b0270a11f21fab381476e680c2c455dda8bc43..c60f834b69b1c966a8f20392d5ad8d1a50cd5b3f 100644 (file)
@@ -40,18 +40,18 @@ class MOSDOpReply : public Message {
   int32_t retry_attempt;
 
 public:
-  object_t get_oid() { return oid; }
-  pg_t     get_pg() { return pgid; }
-  int      get_flags() { return flags; }
+  object_t get_oid() const { return oid; }
+  pg_t     get_pg() const { return pgid; }
+  int      get_flags() const { return flags; }
 
-  bool     is_ondisk() { return get_flags() & CEPH_OSD_FLAG_ONDISK; }
-  bool     is_onnvram() { return get_flags() & CEPH_OSD_FLAG_ONNVRAM; }
+  bool     is_ondisk() const { return get_flags() & CEPH_OSD_FLAG_ONDISK; }
+  bool     is_onnvram() const { return get_flags() & CEPH_OSD_FLAG_ONNVRAM; }
   
-  int get_result() { return result; }
+  int get_result() const { return result; }
   eversion_t get_version() { return reassert_version; }
   
-  bool may_read() { return flags & CEPH_OSD_FLAG_READ; }
-  bool may_write() { return flags & CEPH_OSD_FLAG_WRITE; }
+  bool may_read() const { return flags & CEPH_OSD_FLAG_READ; }
+  bool may_write() const { return flags & CEPH_OSD_FLAG_WRITE; }
 
   void set_result(int r) { result = r; }
   void set_version(eversion_t v) { reassert_version = v; }
@@ -190,9 +190,9 @@ public:
     }
   }
 
-  const char *get_type_name() { return "osd_op_reply"; }
+  const char *get_type_name() const { return "osd_op_reply"; }
   
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "osd_op_reply(" << get_tid()
        << " " << oid << " " << ops;
     if (may_write()) {
index 44afdf149cdcfc4a5787f56e8083050e919cefc0..7e6c45e1e9a705d55bee17ab3d4991da142cb936 100644 (file)
@@ -25,7 +25,7 @@ public:
     OP_BACKFILL_FINISH = 3,
     OP_BACKFILL_FINISH_ACK = 4,
   };
-  const char *get_op_name(int o) {
+  const char *get_op_name(int o) const {
     switch (o) {
     case OP_BACKFILL_PROGRESS: return "progress";
     case OP_BACKFILL_FINISH: return "finish";
@@ -70,8 +70,8 @@ private:
   ~MOSDPGBackfill() {}
 
 public:
-  const char *get_type_name() { return "pg_backfill"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_backfill"; }
+  void print(ostream& out) const {
     out << "pg_backfill(" << get_op_name(op)
        << " " << pgid
        << " e " << map_epoch << "/" << query_epoch
index 3dc6494ac5ad8bba103d06cf640737211f72df32..0efcb0145af09064bc0ec4f9697284f642c2086d 100644 (file)
@@ -52,7 +52,7 @@ private:
   ~MOSDPGCreate() {}
 
 public:  
-  const char *get_type_name() { return "pg_create"; }
+  const char *get_type_name() const { return "pg_create"; }
 
   void encode_payload(uint64_t features) {
     ::encode(epoch, payload);
@@ -64,9 +64,9 @@ public:
     ::decode(mkpg, p);
   }
 
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "osd pg create(";
-    for (map<pg_t,create_rec>::iterator i = mkpg.begin();
+    for (map<pg_t,create_rec>::const_iterator i = mkpg.begin();
          i != mkpg.end();
          ++i) {
       out << "pg" << i->first << "," << i->second.created << "; ";
index cd58e02aa1d61ced67b7c0f458eb717da6fb1795..19ee76673d179096c8ff37a33643ffd9310278ee 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MOSDPGInfo() {}
 
 public:
-  const char *get_type_name() { return "pg_info"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_info"; }
+  void print(ostream& out) const {
     out << "pg_info(" << pg_info.size() << " pgs e" << epoch << ")";
   }
 
index 9b3cd8539655ee6213d00d1d5492d712753256c3..774e1357ae9d27e9f628e1215a178099532cb76b 100644 (file)
@@ -46,8 +46,8 @@ private:
   ~MOSDPGLog() {}
 
 public:
-  const char *get_type_name() { return "PGlog"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "PGlog"; }
+  void print(ostream& out) const {
     out << "pg_log(" << info.pgid << " epoch " << epoch
        << " query_epoch " << query_epoch << ")";
   }
index 8173b2d8f41cece9bc52b2d4059af2d509c3cc45..17b6bdb8f82b6de921ba03ab25fe21b38d49467a 100644 (file)
@@ -36,8 +36,8 @@ private:
   ~MOSDPGMissing() {}
 
 public:
-  const char *get_type_name() { return "pg_missing"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_missing"; }
+  void print(ostream& out) const {
     out << "pg_missing(" << info.pgid << " e" << epoch << ")";
   }
 
index 9cc12cb26e269e9f0be32e924d290ad5ede6caf4..3ea09b97adbb3ba316ce0f2ac00a8a131db50408 100644 (file)
@@ -47,7 +47,7 @@ private:
   ~MOSDPGNotify() {}
 
 public:  
-  const char *get_type_name() { return "PGnot"; }
+  const char *get_type_name() const { return "PGnot"; }
 
   void encode_payload(uint64_t features) {
     header.version = 2;
@@ -63,9 +63,9 @@ public:
       ::decode(query_epoch, p);
     }
   }
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "pg_notify(";
-    for (vector<PG::Info>::iterator i = pg_list.begin();
+    for (vector<PG::Info>::const_iterator i = pg_list.begin();
          i != pg_list.end();
          ++i) {
       if (i != pg_list.begin())
index 9a46932f5aba39b733f3b9a3b74c70c0e08d0b6f..8e8a84b1cf13097255a2186115156d342dcf2b24 100644 (file)
@@ -39,10 +39,10 @@ private:
   ~MOSDPGQuery() {}
 
 public:  
-  const char *get_type_name() { return "pg_query"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_query"; }
+  void print(ostream& out) const {
     out << "pg_query(";
-    for (map<pg_t,PG::Query>::iterator p = pg_list.begin(); p != pg_list.end(); ++p) {
+    for (map<pg_t,PG::Query>::const_iterator p = pg_list.begin(); p != pg_list.end(); ++p) {
       if (p != pg_list.begin())
        out << ",";
       out << p->first;
index 333201ceb86aaafbb983b7d91dfe8ab93cfdb307..bc8a343db0d1f00c2d669e865f1a0af8cea957c7 100644 (file)
@@ -37,7 +37,7 @@ private:
   ~MOSDPGRemove() {}
 
 public:  
-  const char *get_type_name() { return "PGrm"; }
+  const char *get_type_name() const { return "PGrm"; }
 
   void encode_payload(uint64_t features) {
     ::encode(epoch, payload);
@@ -48,9 +48,9 @@ public:
     ::decode(epoch, p);
     ::decode(pg_list, p);
   }
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "osd pg remove(" << "epoch " << epoch << "; ";
-    for (vector<pg_t>::iterator i = pg_list.begin();
+    for (vector<pg_t>::const_iterator i = pg_list.begin();
          i != pg_list.end();
          ++i) {
       out << "pg" << *i << "; ";
index 4ed1d91c6bf735bc5e4f7aa3f74069110a27abfc..cc69b92e170b7add8e19ba8072c1eeadfc86c728 100644 (file)
@@ -24,7 +24,7 @@ public:
     OP_SCAN_GET_DIGEST = 1,      // just objects and versions
     OP_SCAN_DIGEST = 2,          // result
   };
-  const char *get_op_name(int o) {
+  const char *get_op_name(int o) const {
     switch (o) {
     case OP_SCAN_GET_DIGEST: return "get_digest";
     case OP_SCAN_DIGEST: return "digest";
@@ -68,8 +68,8 @@ private:
   ~MOSDPGScan() {}
 
 public:
-  const char *get_type_name() { return "pg_scan"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_scan"; }
+  void print(ostream& out) const {
     out << "pg_scan(" << get_op_name(op)
        << " " << pgid
        << " " << begin << "-" << end
index 5eb5a557d274be63471f92e8b3b4d6f2a5fff705..fe5908ce06734a14653b98f20905f468bced9537 100644 (file)
@@ -42,8 +42,8 @@ public:
     ::decode(pg_temp, p);
   }
 
-  const char *get_type_name() { return "osd_pgtemp"; }
-  void print(ostream &out) {
+  const char *get_type_name() const { return "osd_pgtemp"; }
+  void print(ostream &out) const {
     out << "osd_pgtemp(e" << map_epoch << " " << pg_temp << " v" << version << ")";
   }
   
index 702cb5e5310eeb69e13e9ea9fed55de593edfed5..ad1efa3ac5943467b103d3724d223ddb7adc39a8 100644 (file)
@@ -33,8 +33,8 @@ private:
   ~MOSDPGTrim() {}
 
 public:
-  const char *get_type_name() { return "pg_trim"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_trim"; }
+  void print(ostream& out) const {
     out << "pg_trim(" << pgid << " to " << trim_to << " e" << epoch << ")";
   }
 
index 7bdc8ef65fb5db732c7cbe2e4697ea17d5b822be..9956ef25ad95dfe663a9d3c9de46a08e73d1a9de 100644 (file)
@@ -29,7 +29,7 @@ class MOSDPing : public Message {
     YOU_DIED = 2,
     STOP_HEARTBEAT = 3,
   };
-  const char *get_op_name(int op) {
+  const char *get_op_name(int op) const {
     switch (op) {
     case HEARTBEAT: return "heartbeat";
     case START_HEARTBEAT: return "start_heartbeat";
@@ -69,8 +69,8 @@ public:
     ::encode(peer_stat, payload);
   }
 
-  const char *get_type_name() { return "osd_ping"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "osd_ping"; }
+  void print(ostream& out) const {
     out << "osd_ping(" << get_op_name(op) << " e" << map_epoch << " as_of " << peer_as_of_epoch << ")";
   }
 };
index 9837f287e18ba656ab61d33eee997c8415850500..522bfb22b21d99af176af389f0a35ff983c2c706 100644 (file)
@@ -41,8 +41,8 @@ private:
   ~MOSDRepScrub() {}
 
 public:
-  const char *get_type_name() { return "replica scrub"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "replica scrub"; }
+  void print(ostream& out) const {
     out << "replica scrub(pg: ";
     out << pgid << ",from:" << scrub_from << ",to:" << scrub_to
        << "epoch:" << map_epoch;
index 2f814e7d6149109e69d2be23a25a98cb2555856c..67633e82d14f13a7a2f1a8a377e15c8bca27668b 100644 (file)
@@ -38,8 +38,8 @@ private:
   ~MOSDScrub() {}
 
 public:
-  const char *get_type_name() { return "scrub"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "scrub"; }
+  void print(ostream& out) const {
     out << "scrub(";
     if (scrub_pgs.empty())
       out << "osd";
index f7596e953e5e2402eccede3ba283daabb2050c77..81aba7f3366dbe661a940f95732061ca31807de3 100644 (file)
@@ -170,8 +170,8 @@ private:
   ~MOSDSubOp() {}
 
 public:
-  const char *get_type_name() { return "osd_sub_op"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "osd_sub_op"; }
+  void print(ostream& out) const {
     out << "osd_sub_op(" << reqid
        << " " << pgid
        << " " << poid
index 920fe78ac6451599b431dd296460d13f34fc7031..aa186372bbbe45b4cf7355ad8ff877d012d2a210 100644 (file)
@@ -124,9 +124,9 @@ private:
   ~MOSDSubOpReply() {}
 
 public:
-  const char *get_type_name() { return "osd_op_reply"; }
+  const char *get_type_name() const { return "osd_op_reply"; }
   
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "osd_sub_op_reply(" << reqid
        << " " << pgid 
        << " " << poid << " " << ops;
index e5af677070bbf76643d370ce320f8c009f474472..633800aad152aab0d65a8a7b46b985f53ceed61a 100644 (file)
@@ -34,8 +34,8 @@ private:
   ~MPGStats() {};
 
 public:
-  const char *get_type_name() { return "pg_stats"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_stats"; }
+  void print(ostream& out) const {
     out << "pg_stats(" << pg_stat.size() << " pgs tid " << get_tid() << " v " << version << ")";
   }
 
index 045ad4bfe16c8aabb5180a711f1a6fae87e1ba6f..f268b68f9b8b33255f0071ca755b3e8d2b861824 100644 (file)
@@ -27,8 +27,8 @@ private:
   ~MPGStatsAck() {}
 
 public:
-  const char *get_type_name() { return "pg_stats_ack"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "pg_stats_ack"; }
+  void print(ostream& out) const {
     out << "pg_stats_ack(" << pg_stat.size() << " pgs tid " << get_tid() << ")";
   }
 
index 005f11c786bfd7c94fb919c6d5e17f3b32e6c490..3cd051497eaa5093adb3dc202e8dc3b5d279e1da 100644 (file)
@@ -29,7 +29,7 @@ private:
 public:
   void decode_payload() { }
   void encode_payload(uint64_t features) { }
-  const char *get_type_name() { return "ping"; }
+  const char *get_type_name() const { return "ping"; }
 };
 
 #endif
index 5ed45944bab940c91c48f9dc64e4e4dd730db49b..c4ec9d863444ca6c52042e8ad578141b62e6ceb0 100644 (file)
@@ -45,8 +45,8 @@ private:
   ~MPoolOp() {}
 
 public:
-  const char *get_type_name() { return "poolop"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "poolop"; }
+  void print(ostream& out) const {
     out << "pool_op(" << ceph_pool_op_name(op) << " pool " << pool
        << " auid " << auid
        << " tid " << get_tid()
index b3002289c62b33bd0db0fb20c4b6ea2b6d4a6cb9..702fdf757d95f4c3d571db6789d87c387d909787 100644 (file)
@@ -44,9 +44,9 @@ public:
       response_data.claim(*blp);
   }
 
-  const char *get_type_name() { return "poolopreply"; }
+  const char *get_type_name() const { return "poolopreply"; }
 
-  void print(ostream& out) {
+  void print(ostream& out) const {
     out << "pool_op_reply(tid " << get_tid()
        << " " << cpp_strerror(-replyCode)
        << " v" << version << ")";
index 21fffc05cf5d74945072a71a40bac42babeb1ba9..6568ffaeb07850333671810b65e0d3d49f718467 100644 (file)
@@ -30,8 +30,8 @@ private:
   ~MRemoveSnaps() {}
 
 public:
-  const char *get_type_name() { return "remove_snaps"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "remove_snaps"; }
+  void print(ostream& out) const {
     out << "remove_snaps(" << snaps << " v" << version << ")";
   }
 
index 050e265ef45362939561f04fcce201cda7c81cca..7efa13683adda11c31bb53395a94a7ea36bf2d29 100644 (file)
@@ -51,8 +51,8 @@ public:
     encode_message(msg, features, payload);
   }
 
-  const char *get_type_name() { return "route"; }
-  void print(ostream& o) {
+  const char *get_type_name() const { return "route"; }
+  void print(ostream& o) const {
     if (msg)
       o << "route(" << *msg;
     else
index dac147f442e6161285b537bfebd839d35c90197d..61370a943442d22180b9d9dd9b1ccc5776798881 100644 (file)
@@ -33,8 +33,8 @@ private:
   ~MStatfs() {}
 
 public:
-  const char *get_type_name() { return "statfs"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "statfs"; }
+  void print(ostream& out) const {
     out << "statfs(" << get_tid() << " v" << version << ")";
   }
 
index bdf52664d230131f9ca126798af4346faa3e2a9f..8ceec9c7b10ee1a4ba535852b7748578b0018ce7 100644 (file)
@@ -27,8 +27,8 @@ public:
     h.version = epoch;
   }
 
-  const char *get_type_name() { return "statfs_reply"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "statfs_reply"; }
+  void print(ostream& out) const {
     out << "statfs_reply(" << header.tid << ")";
   }
 
index d39fc99b936e339ee38519daf1c2d88837f15bae..66632f72002b0c5da3eaa7217ccc2ba0a4c5bbcb 100644 (file)
@@ -55,8 +55,8 @@ public:
     ::encode(bl, payload);
   }
 
-  const char *get_type_name() { return "watch-notify"; }
-  void print(ostream& out) {
+  const char *get_type_name() const { return "watch-notify"; }
+  void print(ostream& out) const {
     out << "watch-notify(c=" << cookie << " v=" << ver << " i=" << notify_id << " opcode=" << (int)opcode << ")";
   }
 };
index 88c908d253f204a19bdf1cafa5e35e9251b0620e..341a0b3f308cc7fd89f87977bbaceb6354cb1105 100644 (file)
@@ -56,7 +56,7 @@ class PaxosServiceMessage : public Message {
     return session;
   }
   
-  const char *get_type_name() { return "PaxosServiceMessage"; }
+  const char *get_type_name() const { return "PaxosServiceMessage"; }
 };
 
 #endif
index 6159b9d4bbfa6f29d9a6fd3969e5660692269d02..53d216a46789a4b813cfbe26333b8711eb93a995 100644 (file)
@@ -380,7 +380,7 @@ public:
   off_t get_data_len() { return data.length(); }
 
   void set_recv_stamp(utime_t t) { recv_stamp = t; }
-  utime_t get_recv_stamp() { return recv_stamp; }
+  utime_t get_recv_stamp() const { return recv_stamp; }
 
   void calc_header_crc() {
     header.crc = ceph_crc32c_le(0, (unsigned char*)&header,
@@ -395,47 +395,47 @@ public:
   }
 
   // type
-  int get_type() { return header.type; }
+  int get_type() const { return header.type; }
   void set_type(int t) { header.type = t; }
 
-  uint64_t get_tid() { return header.tid; }
+  uint64_t get_tid() const { return header.tid; }
   void set_tid(uint64_t t) { header.tid = t; }
 
-  unsigned get_seq() { return header.seq; }
+  unsigned get_seq() const { return header.seq; }
   void set_seq(unsigned s) { header.seq = s; }
 
-  unsigned get_priority() { return header.priority; }
+  unsigned get_priority() const { return header.priority; }
   void set_priority(__s16 p) { header.priority = p; }
 
   // source/dest
-  entity_inst_t get_source_inst() {
+  entity_inst_t get_source_inst() const {
     return entity_inst_t(get_source(), get_source_addr());
   }
-  entity_name_t get_source() {
+  entity_name_t get_source() const {
     return entity_name_t(header.src);
   }
-  entity_addr_t get_source_addr() {
+  entity_addr_t get_source_addr() const {
     if (connection)
       return connection->get_peer_addr();
     return entity_addr_t();
   }
 
   // forwarded?
-  entity_inst_t get_orig_source_inst() {
+  entity_inst_t get_orig_source_inst() const {
     return get_source_inst();
   }
-  entity_name_t get_orig_source() {
+  entity_name_t get_orig_source() const {
     return get_orig_source_inst().name;
   }
-  entity_addr_t get_orig_source_addr() {
+  entity_addr_t get_orig_source_addr() const {
     return get_orig_source_inst().addr;
   }
 
   // virtual bits
   virtual void decode_payload() = 0;
   virtual void encode_payload(uint64_t features) = 0;
-  virtual const char *get_type_name() = 0;
-  virtual void print(ostream& out) {
+  virtual const char *get_type_name() const = 0;
+  virtual void print(ostream& out) const {
     out << get_type_name();
   }
 
index eb70aea2aa177078526f8756932f50981df11814..cd357af627e364e7e262fa44cc09ad4927743605 100644 (file)
@@ -1082,7 +1082,7 @@ void Objecter::send_op(Op *op)
 
   m->set_snapid(op->snapid);
   m->set_snap_seq(op->snapc.seq);
-  m->get_snaps() = op->snapc.snaps;
+  m->set_snaps(op->snapc.snaps);
 
   m->ops = op->ops;
   m->set_mtime(op->mtime);