#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;
}
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";
}
}
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);
}
};