]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MPoolOp.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / messages / MPoolOp.h
index d13c87717c00f283988ec3ce306828b2eb2f59df..bc46f93d1ff651e1ac98fec8cb3e73ac9f4512d5 100644 (file)
@@ -18,9 +18,7 @@
 #include "messages/PaxosServiceMessage.h"
 
 
-class MPoolOp : public MessageInstance<MPoolOp, PaxosServiceMessage> {
-public:
-  friend factory;
+class MPoolOp : public PaxosServiceMessage {
 private:
   static constexpr int HEAD_VERSION = 4;
   static constexpr int COMPAT_VERSION = 2;
@@ -28,15 +26,15 @@ private:
 public:
   uuid_d fsid;
   __u32 pool = 0;
-  string name;
+  std::string name;
   __u32 op = 0;
   snapid_t snapid;
   __s16 crush_rule = 0;
 
   MPoolOp()
-    : MessageInstance(CEPH_MSG_POOLOP, 0, HEAD_VERSION, COMPAT_VERSION) { }
-  MPoolOp(const uuid_d& f, ceph_tid_t t, int p, string& n, int o, version_t v)
-    : MessageInstance(CEPH_MSG_POOLOP, v, HEAD_VERSION, COMPAT_VERSION),
+    : PaxosServiceMessage{CEPH_MSG_POOLOP, 0, HEAD_VERSION, COMPAT_VERSION} {}
+  MPoolOp(const uuid_d& f, ceph_tid_t t, int p, std::string& n, int o, version_t v)
+    : PaxosServiceMessage{CEPH_MSG_POOLOP, v, HEAD_VERSION, COMPAT_VERSION},
       fsid(f), pool(p), name(n), op(o),
       snapid(0), crush_rule(0) {
     set_tid(t);
@@ -47,7 +45,7 @@ private:
 
 public:
   std::string_view get_type_name() const override { return "poolop"; }
-  void print(ostream& out) const override {
+  void print(std::ostream& out) const override {
     out << "pool_op(" << ceph_pool_op_name(op) << " pool " << pool
        << " tid " << get_tid()
        << " name " << name
@@ -68,6 +66,7 @@ public:
     encode(crush_rule, payload);
   }
   void decode_payload() override {
+    using ceph::decode;
     auto p = payload.cbegin();
     paxos_decode(p);
     decode(fsid, p);
@@ -91,6 +90,9 @@ public:
     } else
       crush_rule = -1;
   }
+private:
+  template<class T, typename... Args>
+  friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
 };
 
 #endif