]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MPoolOpReply.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / messages / MPoolOpReply.h
index 41a6dfbb4ab1ea3e1b8ef167cb80464d75811e1c..df06525db78165db3107ed37e560538eb85db482 100644 (file)
 
 #include "common/errno.h"
 
-class MPoolOpReply : public MessageInstance<MPoolOpReply, PaxosServiceMessage> {
+class MPoolOpReply : public PaxosServiceMessage {
 public:
-  friend factory;
-
   uuid_d fsid;
   __u32 replyCode = 0;
   epoch_t epoch = 0;
-  bufferlist response_data;
+  ceph::buffer::list response_data;
 
-  MPoolOpReply() : MessageInstance(CEPH_MSG_POOLOP_REPLY, 0)
+  MPoolOpReply() : PaxosServiceMessage{CEPH_MSG_POOLOP_REPLY, 0}
   {}
   MPoolOpReply( uuid_d& f, ceph_tid_t t, int rc, int e, version_t v) :
-    MessageInstance(CEPH_MSG_POOLOP_REPLY, v),
+    PaxosServiceMessage{CEPH_MSG_POOLOP_REPLY, v},
     fsid(f),
     replyCode(rc),
     epoch(e) {
     set_tid(t);
   }
-  MPoolOpReply( uuid_d& f, ceph_tid_t t, int rc, int e, version_t v,
-               bufferlist *blp) :
-    MessageInstance(CEPH_MSG_POOLOP_REPLY, v),
+  MPoolOpReply(uuid_d& f, ceph_tid_t t, int rc, int e, version_t v,
+              ceph::buffer::list *blp) :
+    PaxosServiceMessage{CEPH_MSG_POOLOP_REPLY, v},
     fsid(f),
     replyCode(rc),
     epoch(e) {
@@ -48,7 +46,7 @@ public:
 
   std::string_view get_type_name() const override { return "poolopreply"; }
 
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "pool_op_reply(tid " << get_tid()
        << " " << cpp_strerror(-replyCode)
        << " v" << version << ")";
@@ -67,6 +65,7 @@ public:
       encode(false, payload);
   }
   void decode_payload() override {
+    using ceph::decode;
     auto p = payload.cbegin();
     paxos_decode(p);
     decode(fsid, p);
@@ -78,6 +77,9 @@ public:
       decode(response_data, p);
     }
   }
+private:
+  template<class T, typename... Args>
+  friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
 };
 
 #endif