]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/messages/MOSDScrubReserve.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / messages / MOSDScrubReserve.h
index 6eb39967a943597dab3ff48d718b34e48a1c8b65..a75796f9ae8aac09e320ba00b4058398124711db 100644 (file)
 
 #include "MOSDFastDispatchOp.h"
 
-class MOSDScrubReserve : public MOSDFastDispatchOp {
-  static const int HEAD_VERSION = 1;
-  static const int COMPAT_VERSION = 1;
+class MOSDScrubReserve : public MessageInstance<MOSDScrubReserve, MOSDFastDispatchOp> {
+public:
+  friend factory;
+private:
+  static constexpr int HEAD_VERSION = 1;
+  static constexpr int COMPAT_VERSION = 1;
 public:
   spg_t pgid;
   epoch_t map_epoch;
@@ -40,17 +43,17 @@ public:
   }
 
   MOSDScrubReserve()
-    : MOSDFastDispatchOp(MSG_OSD_SCRUB_RESERVE, HEAD_VERSION, COMPAT_VERSION),
+    : MessageInstance(MSG_OSD_SCRUB_RESERVE, HEAD_VERSION, COMPAT_VERSION),
       map_epoch(0), type(-1) {}
   MOSDScrubReserve(spg_t pgid,
                   epoch_t map_epoch,
                   int type,
                   pg_shard_t from)
-    : MOSDFastDispatchOp(MSG_OSD_SCRUB_RESERVE, HEAD_VERSION, COMPAT_VERSION),
+    : MessageInstance(MSG_OSD_SCRUB_RESERVE, HEAD_VERSION, COMPAT_VERSION),
       pgid(pgid), map_epoch(map_epoch),
       type(type), from(from) {}
 
-  const char *get_type_name() const {
+  std::string_view get_type_name() const {
     return "MOSDScrubReserve";
   }
 
@@ -75,18 +78,19 @@ public:
   }
 
   void decode_payload() {
-    bufferlist::iterator p = payload.begin();
-    ::decode(pgid, p);
-    ::decode(map_epoch, p);
-    ::decode(type, p);
-    ::decode(from, p);
+    auto p = payload.cbegin();
+    decode(pgid, p);
+    decode(map_epoch, p);
+    decode(type, p);
+    decode(from, p);
   }
 
   void encode_payload(uint64_t features) {
-    ::encode(pgid, payload);
-    ::encode(map_epoch, payload);
-    ::encode(type, payload);
-    ::encode(from, payload);
+    using ceph::encode;
+    encode(pgid, payload);
+    encode(map_epoch, payload);
+    encode(type, payload);
+    encode(from, payload);
   }
 };