]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: constify misc messages
authorSage Weil <sage@redhat.com>
Mon, 20 Feb 2017 19:18:11 +0000 (14:18 -0500)
committerSage Weil <sage@redhat.com>
Mon, 20 Feb 2017 19:22:07 +0000 (14:22 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDFailure.h
src/messages/MOSDMarkMeDown.h
src/messages/MOSDOp.h
src/messages/MOSDOpReply.h
src/messages/MOSDPGTrim.h
src/messages/MOSDRepOpReply.h
src/messages/MOSDSubOpReply.h

index 2b51a620a6f7b47d6ae664cd94dbb1436b91467a..7f0fb86686120d5a50ef239507265d2427e7afa1 100644 (file)
@@ -59,7 +59,7 @@ public:
   bool is_immediate() const { 
     return flags & FLAG_IMMEDIATE; 
   }
-  epoch_t get_epoch() { return epoch; }
+  epoch_t get_epoch() const { return epoch; }
 
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
index cb6772989b2cf597dc13a03e85e2e1de0517e9a9..46df68bd9595c536c3a2f65f3fd3970606d83cc9 100644 (file)
@@ -40,8 +40,8 @@ class MOSDMarkMeDown : public PaxosServiceMessage {
   ~MOSDMarkMeDown() {}
 
 public: 
-  entity_inst_t get_target() { return target_osd; }
-  epoch_t get_epoch() { return epoch; }
+  entity_inst_t get_target() const { return target_osd; }
+  epoch_t get_epoch() const { return epoch; }
 
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
index 5c2db7b011b4854b3eda08bcadb7743682be7c58..89e1a8a45c5fea3efd492709940d2306beba9e23 100755 (executable)
@@ -130,14 +130,14 @@ public:
     else
       return object_locator_t(hobj);
   }
-  object_t& get_oid() {
+  const object_t& get_oid() const {
     assert(!final_decode_needed);
     return hobj.oid;
   }
   const hobject_t &get_hobj() const {
     return hobj;
   }
-  snapid_t get_snapid() {
+  snapid_t get_snapid() const {
     assert(!final_decode_needed);
     return hobj.snap;
   }
@@ -231,7 +231,7 @@ public:
     add_simple_op(CEPH_OSD_OP_STAT, 0, 0);
   }
 
-  bool has_flag(__u32 flag) { return flags & flag; };
+  bool has_flag(__u32 flag) const { return flags & flag; };
   bool wants_ack() const { return flags & CEPH_OSD_FLAG_ACK; }
   bool wants_ondisk() const { return flags & CEPH_OSD_FLAG_ONDISK; }
   bool wants_onnvram() const { return flags & CEPH_OSD_FLAG_ONNVRAM; }
index 3d51d1c21165dbd9229b8bf62eda98215800faf0..49c62ed9ea20eeac460f0928a39e71a00a198613 100644 (file)
@@ -128,7 +128,8 @@ public:
     : Message(CEPH_MSG_OSD_OPREPLY, HEAD_VERSION, COMPAT_VERSION) {
     do_redirect = false;
   }
-  MOSDOpReply(MOSDOp *req, int r, epoch_t e, int acktype, bool ignore_out_data)
+  MOSDOpReply(const MOSDOp *req, int r, epoch_t e, int acktype,
+             bool ignore_out_data)
     : Message(CEPH_MSG_OSD_OPREPLY, HEAD_VERSION, COMPAT_VERSION),
       oid(req->hobj.oid), pgid(req->pgid.pgid), ops(req->ops) {
 
index 6a1a8aa5a7a76f2a19dc537048c33eff320eb2f9..eb19aefa42bd7c6c45849cb7f49f2e9dad2c816b 100644 (file)
@@ -27,7 +27,7 @@ public:
   spg_t pgid;
   eversion_t trim_to;
 
-  epoch_t get_epoch() { return epoch; }
+  epoch_t get_epoch() const { return epoch; }
 
   MOSDPGTrim() : Message(MSG_OSD_PG_TRIM, HEAD_VERSION, COMPAT_VERSION) {}
   MOSDPGTrim(version_t mv, spg_t p, eversion_t tt) :
index 67c2d76bf7357de6cc76bc701acb2ca982e21264..b9c0c22d2af9e390a051704653fbd3eae8dac592 100644 (file)
@@ -95,11 +95,11 @@ public:
   int get_result() { return result; }
 
   void set_last_complete_ondisk(eversion_t v) { last_complete_ondisk = v; }
-  eversion_t get_last_complete_ondisk() { return last_complete_ondisk; }
+  eversion_t get_last_complete_ondisk() const { return last_complete_ondisk; }
 
 public:
   MOSDRepOpReply(
-    MOSDRepOp *req, pg_shard_t from, int result_, epoch_t e, int at) :
+    const MOSDRepOp *req, pg_shard_t from, int result_, epoch_t e, int at) :
     MOSDFastDispatchOp(MSG_OSD_REPOPREPLY, HEAD_VERSION, COMPAT_VERSION),
     map_epoch(e),
     reqid(req->reqid),
index aa300efc9314f544f757cbd2dfe90e5b64253ee0..95965697a6cfab8c5d0ffd02adebb463a7faf065 100644 (file)
@@ -116,8 +116,8 @@ public:
 
   epoch_t get_map_epoch() { return map_epoch; }
 
-  spg_t get_pg() { return pgid; }
-  hobject_t get_poid() { return poid; }
+  spg_t get_pg() const { return pgid; }
+  const hobject_t& get_poid() const { return poid; }
 
   int get_ack_type() { return ack_type; }
   bool is_ondisk() { return ack_type & CEPH_OSD_FLAG_ONDISK; }
@@ -136,7 +136,7 @@ public:
 
 public:
   MOSDSubOpReply(
-    MOSDSubOp *req, pg_shard_t from, int result_, epoch_t e, int at)
+    const MOSDSubOp *req, pg_shard_t from, int result_, epoch_t e, int at)
     : MOSDFastDispatchOp(MSG_OSD_SUBOPREPLY, HEAD_VERSION, COMPAT_VERSION),
       map_epoch(e),
       reqid(req->reqid),