msg: cleanup factory/ref definition in messages

This eliminates duplicate code definitions.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2018-07-31 13:59:52 -07:00
parent 6632131da1
commit e0d3db8904
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
152 changed files with 458 additions and 900 deletions

View File

@ -17,11 +17,8 @@
#include "messages/PaxosServiceMessage.h"
class MAuth : public PaxosServiceMessage {
class MAuth : public MessageInstance<MAuth, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MAuth> ref;
typedef boost::intrusive_ptr<MAuth const> const_ref;
using factory = MessageFactory<MAuth>;
friend factory;
__u32 protocol;
@ -30,7 +27,7 @@ public:
/* if protocol == 0, then auth_payload is a set<__u32> listing protocols the client supports */
MAuth() : PaxosServiceMessage(CEPH_MSG_AUTH, 0), protocol(0), monmap_epoch(0) { }
MAuth() : MessageInstance(CEPH_MSG_AUTH, 0), protocol(0), monmap_epoch(0) { }
private:
~MAuth() override {}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "common/errno.h"
class MAuthReply : public Message {
class MAuthReply : public MessageInstance<MAuthReply> {
public:
typedef boost::intrusive_ptr<MAuthReply> ref;
typedef boost::intrusive_ptr<MAuthReply const> const_ref;
using factory = MessageFactory<MAuthReply>;
friend factory;
__u32 protocol;
@ -31,9 +28,9 @@ public:
string result_msg;
bufferlist result_bl;
MAuthReply() : Message(CEPH_MSG_AUTH_REPLY), protocol(0), result(0), global_id(0) {}
MAuthReply() : MessageInstance(CEPH_MSG_AUTH_REPLY), protocol(0), result(0), global_id(0) {}
MAuthReply(__u32 p, bufferlist *bl = NULL, int r = 0, uint64_t gid=0, const char *msg = "") :
Message(CEPH_MSG_AUTH_REPLY),
MessageInstance(CEPH_MSG_AUTH_REPLY),
protocol(p), result(r), global_id(gid),
result_msg(msg) {
if (bl)

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "messages/MOSDPeeringOp.h"
class MBackfillReserve : public MOSDPeeringOp {
class MBackfillReserve : public MessageInstance<MBackfillReserve, MOSDPeeringOp> {
public:
typedef boost::intrusive_ptr<MBackfillReserve> ref;
typedef boost::intrusive_ptr<MBackfillReserve const> const_ref;
using factory = MessageFactory<MBackfillReserve>;
friend factory;
private:
static const int HEAD_VERSION = 4;
@ -95,12 +92,12 @@ public:
}
MBackfillReserve()
: MOSDPeeringOp(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
query_epoch(0), type(-1), priority(-1) {}
MBackfillReserve(int type,
spg_t pgid,
epoch_t query_epoch, unsigned prio = -1)
: MOSDPeeringOp(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_BACKFILL_RESERVE, HEAD_VERSION, COMPAT_VERSION),
pgid(pgid), query_epoch(query_epoch),
type(type), priority(prio) {}

View File

@ -21,11 +21,8 @@
#include "mds/mdstypes.h"
class MCacheExpire : public Message {
class MCacheExpire : public MessageInstance<MCacheExpire> {
public:
typedef boost::intrusive_ptr<MCacheExpire> ref;
typedef boost::intrusive_ptr<MCacheExpire const> const_ref;
using factory = MessageFactory<MCacheExpire>;
friend factory;
private:
__s32 from;
@ -71,9 +68,9 @@ public:
int get_from() const { return from; }
protected:
MCacheExpire() : Message(MSG_MDS_CACHEEXPIRE), from(-1) {}
MCacheExpire() : MessageInstance(MSG_MDS_CACHEEXPIRE), from(-1) {}
MCacheExpire(int f) :
Message(MSG_MDS_CACHEEXPIRE),
MessageInstance(MSG_MDS_CACHEEXPIRE),
from(f) { }
~MCacheExpire() override {}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
class MClientCapRelease : public Message {
class MClientCapRelease : public MessageInstance<MClientCapRelease> {
public:
typedef boost::intrusive_ptr<MClientCapRelease> ref;
typedef boost::intrusive_ptr<MClientCapRelease const> const_ref;
using factory = MessageFactory<MClientCapRelease>;
friend factory;
private:
@ -38,7 +35,7 @@ private:
epoch_t osd_epoch_barrier;
MClientCapRelease() :
Message(CEPH_MSG_CLIENT_CAPRELEASE, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(CEPH_MSG_CLIENT_CAPRELEASE, HEAD_VERSION, COMPAT_VERSION),
osd_epoch_barrier(0)
{
memset(&head, 0, sizeof(head));

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "include/ceph_features.h"
class MClientCaps : public Message {
class MClientCaps : public MessageInstance<MClientCaps> {
public:
typedef boost::intrusive_ptr<MClientCaps> ref;
typedef boost::intrusive_ptr<MClientCaps const> const_ref;
using factory = MessageFactory<MClientCaps>;
friend factory;
private:
@ -133,7 +130,7 @@ private:
protected:
MClientCaps()
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION) {}
: MessageInstance(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION) {}
MClientCaps(int op,
inodeno_t ino,
inodeno_t realm,
@ -144,7 +141,7 @@ protected:
int dirty,
int mseq,
epoch_t oeb)
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
osd_epoch_barrier(oeb) {
memset(&head, 0, sizeof(head));
head.op = op;
@ -161,7 +158,7 @@ protected:
MClientCaps(int op,
inodeno_t ino, inodeno_t realm,
uint64_t id, int mseq, epoch_t oeb)
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
osd_epoch_barrier(oeb) {
memset(&head, 0, sizeof(head));
head.op = op;

View File

@ -20,11 +20,8 @@
#include "msg/Message.h"
class MClientLease : public Message {
class MClientLease : public MessageInstance<MClientLease> {
public:
typedef boost::intrusive_ptr<MClientLease> ref;
typedef boost::intrusive_ptr<MClientLease const> const_ref;
using factory = MessageFactory<MClientLease>;
friend factory;
struct ceph_mds_lease h;
@ -38,13 +35,13 @@ public:
snapid_t get_last() const { return snapid_t(h.last); }
protected:
MClientLease() : Message(CEPH_MSG_CLIENT_LEASE) {}
MClientLease() : MessageInstance(CEPH_MSG_CLIENT_LEASE) {}
MClientLease(const MClientLease& m) :
Message(CEPH_MSG_CLIENT_LEASE),
MessageInstance(CEPH_MSG_CLIENT_LEASE),
h(m.h),
dname(m.dname) {}
MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl) :
Message(CEPH_MSG_CLIENT_LEASE) {
MessageInstance(CEPH_MSG_CLIENT_LEASE) {
h.action = ac;
h.seq = seq;
h.mask = m;
@ -54,7 +51,7 @@ protected:
h.duration_ms = 0;
}
MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl, std::string_view d) :
Message(CEPH_MSG_CLIENT_LEASE),
MessageInstance(CEPH_MSG_CLIENT_LEASE),
dname(d) {
h.action = ac;
h.seq = seq;

View File

@ -3,11 +3,8 @@
#include "msg/Message.h"
class MClientQuota : public Message {
class MClientQuota : public MessageInstance<MClientQuota> {
public:
typedef boost::intrusive_ptr<MClientQuota> ref;
typedef boost::intrusive_ptr<MClientQuota const> const_ref;
using factory = MessageFactory<MClientQuota>;
friend factory;
inodeno_t ino;
@ -16,7 +13,7 @@ public:
protected:
MClientQuota() :
Message(CEPH_MSG_CLIENT_QUOTA),
MessageInstance(CEPH_MSG_CLIENT_QUOTA),
ino(0)
{}
~MClientQuota() override {}

View File

@ -20,11 +20,8 @@
#include "include/ceph_features.h"
class MClientReconnect : public Message {
class MClientReconnect : public MessageInstance<MClientReconnect> {
public:
typedef boost::intrusive_ptr<MClientReconnect> ref;
typedef boost::intrusive_ptr<MClientReconnect const> const_ref;
using factory = MessageFactory<MClientReconnect>;
friend factory;
private:
const static int HEAD_VERSION = 3;
@ -33,7 +30,7 @@ public:
map<inodeno_t, cap_reconnect_t> caps; // only head inodes
vector<ceph_mds_snaprealm_reconnect> realms;
MClientReconnect() : Message(CEPH_MSG_CLIENT_RECONNECT, HEAD_VERSION) { }
MClientReconnect() : MessageInstance(CEPH_MSG_CLIENT_RECONNECT, HEAD_VERSION) { }
private:
~MClientReconnect() override {}

View File

@ -253,11 +253,8 @@ struct InodeStat {
};
class MClientReply : public Message {
class MClientReply : public MessageInstance<MClientReply> {
public:
typedef boost::intrusive_ptr<MClientReply> ref;
typedef boost::intrusive_ptr<MClientReply const> const_ref;
using factory = MessageFactory<MClientReply>;
friend factory;
// reply data
@ -282,9 +279,9 @@ public:
bool is_safe() const { return head.safe; }
protected:
MClientReply() : Message(CEPH_MSG_CLIENT_REPLY) {}
MClientReply() : MessageInstance(CEPH_MSG_CLIENT_REPLY) {}
MClientReply(const MClientRequest &req, int result = 0) :
Message(CEPH_MSG_CLIENT_REPLY) {
MessageInstance(CEPH_MSG_CLIENT_REPLY) {
memset(&head, 0, sizeof(head));
header.tid = req.get_tid();
head.op = req.get_op();

View File

@ -48,11 +48,8 @@
// metadata ops.
class MClientRequest : public Message {
class MClientRequest : public MessageInstance<MClientRequest> {
public:
typedef boost::intrusive_ptr<MClientRequest> ref;
typedef boost::intrusive_ptr<MClientRequest const> const_ref;
using factory = MessageFactory<MClientRequest>;
friend factory;
private:
static const int HEAD_VERSION = 4;
@ -94,9 +91,9 @@ public:
protected:
// cons
MClientRequest()
: Message(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {}
: MessageInstance(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {}
MClientRequest(int op)
: Message(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {
: MessageInstance(CEPH_MSG_CLIENT_REQUEST, HEAD_VERSION, COMPAT_VERSION) {
memset(&head, 0, sizeof(head));
head.op = op;
}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
class MClientRequestForward : public Message {
class MClientRequestForward : public MessageInstance<MClientRequestForward> {
public:
typedef boost::intrusive_ptr<MClientRequestForward> ref;
typedef boost::intrusive_ptr<MClientRequestForward const> const_ref;
using factory = MessageFactory<MClientRequestForward>;
friend factory;
private:
int32_t dest_mds;
@ -31,10 +28,10 @@ private:
protected:
MClientRequestForward()
: Message(CEPH_MSG_CLIENT_REQUEST_FORWARD),
: MessageInstance(CEPH_MSG_CLIENT_REQUEST_FORWARD),
dest_mds(-1), num_fwd(-1), client_must_resend(false) {}
MClientRequestForward(ceph_tid_t t, int dm, int nf, bool cmr) :
Message(CEPH_MSG_CLIENT_REQUEST_FORWARD),
MessageInstance(CEPH_MSG_CLIENT_REQUEST_FORWARD),
dest_mds(dm), num_fwd(nf), client_must_resend(cmr) {
assert(client_must_resend);
header.tid = t;

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "mds/mdstypes.h"
class MClientSession : public Message {
class MClientSession : public MessageInstance<MClientSession> {
public:
typedef boost::intrusive_ptr<MClientSession> ref;
typedef boost::intrusive_ptr<MClientSession const> const_ref;
using factory = MessageFactory<MClientSession>;
friend factory;
private:
static const int HEAD_VERSION = 3;
@ -41,15 +38,15 @@ public:
int get_max_leases() const { return head.max_leases; }
protected:
MClientSession() : Message(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) { }
MClientSession() : MessageInstance(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) { }
MClientSession(int o, version_t s=0) :
Message(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) {
MessageInstance(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) {
memset(&head, 0, sizeof(head));
head.op = o;
head.seq = s;
}
MClientSession(int o, utime_t st) :
Message(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) {
MessageInstance(CEPH_MSG_CLIENT_SESSION, HEAD_VERSION, COMPAT_VERSION) {
memset(&head, 0, sizeof(head));
head.op = o;
head.seq = 0;

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MClientSnap : public Message {
class MClientSnap : public MessageInstance<MClientSnap> {
public:
typedef boost::intrusive_ptr<MClientSnap> ref;
typedef boost::intrusive_ptr<MClientSnap const> const_ref;
using factory = MessageFactory<MClientSnap>;
friend factory;
ceph_mds_snap_head head;
@ -33,7 +30,7 @@ public:
protected:
MClientSnap(int o=0) :
Message(CEPH_MSG_CLIENT_SNAP) {
MessageInstance(CEPH_MSG_CLIENT_SNAP) {
memset(&head, 0, sizeof(head));
head.op = o;
}

View File

@ -19,20 +19,17 @@
#include "msg/Message.h"
class MCommand : public Message {
class MCommand : public MessageInstance<MCommand> {
public:
typedef boost::intrusive_ptr<MCommand> ref;
typedef boost::intrusive_ptr<MCommand const> const_ref;
using factory = MessageFactory<MCommand>;
friend factory;
uuid_d fsid;
std::vector<string> cmd;
MCommand()
: Message(MSG_COMMAND) {}
: MessageInstance(MSG_COMMAND) {}
MCommand(const uuid_d &f)
: Message(MSG_COMMAND),
: MessageInstance(MSG_COMMAND),
fsid(f) { }
private:

View File

@ -20,24 +20,21 @@
#include "msg/Message.h"
#include "MCommand.h"
class MCommandReply : public Message {
class MCommandReply : public MessageInstance<MCommandReply> {
public:
typedef boost::intrusive_ptr<MCommandReply> ref;
typedef boost::intrusive_ptr<MCommandReply const> const_ref;
using factory = MessageFactory<MCommandReply>;
friend factory;
errorcode32_t r;
string rs;
MCommandReply()
: Message(MSG_COMMAND_REPLY) {}
: MessageInstance(MSG_COMMAND_REPLY) {}
MCommandReply(MCommand *m, int _r)
: Message(MSG_COMMAND_REPLY), r(_r) {
: MessageInstance(MSG_COMMAND_REPLY), r(_r) {
header.tid = m->get_tid();
}
MCommandReply(int _r, std::string_view s)
: Message(MSG_COMMAND_REPLY),
: MessageInstance(MSG_COMMAND_REPLY),
r(_r), rs(s) { }
private:
~MCommandReply() override {}

View File

@ -5,11 +5,8 @@
#include "msg/Message.h"
class MConfig : public Message {
class MConfig : public MessageInstance<MConfig> {
public:
typedef boost::intrusive_ptr<MConfig> ref;
typedef boost::intrusive_ptr<MConfig const> const_ref;
using factory = MessageFactory<MConfig>;
friend factory;
static const int HEAD_VERSION = 1;
@ -17,9 +14,9 @@ public:
map<string,string> config;
MConfig() : Message(MSG_CONFIG, HEAD_VERSION, COMPAT_VERSION) { }
MConfig() : MessageInstance(MSG_CONFIG, HEAD_VERSION, COMPAT_VERSION) { }
MConfig(const map<string,string>& c)
: Message(MSG_CONFIG, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_CONFIG, HEAD_VERSION, COMPAT_VERSION),
config(c) {}
const char *get_type_name() const override {

View File

@ -28,11 +28,8 @@ struct xio_reg_mem {};
typedef void (*mdata_hook_func)(struct xio_reg_mem *mp);
class MDataPing : public Message {
class MDataPing : public MessageInstance<MDataPing> {
public:
typedef boost::intrusive_ptr<MDataPing> ref;
typedef boost::intrusive_ptr<MDataPing const> const_ref;
using factory = MessageFactory<MDataPing>;
friend factory;
static const int HEAD_VERSION = 1;
@ -45,7 +42,7 @@ public:
bool free_data;
MDataPing()
: Message(MSG_DATA_PING, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_DATA_PING, HEAD_VERSION, COMPAT_VERSION),
mdata_hook(NULL),
free_data(false)
{}

View File

@ -20,11 +20,8 @@
#include "msg/Message.h"
class MDentryLink : public Message {
class MDentryLink : public MessageInstance<MDentryLink> {
public:
typedef boost::intrusive_ptr<MDentryLink> ref;
typedef boost::intrusive_ptr<MDentryLink const> const_ref;
using factory = MessageFactory<MDentryLink>;
friend factory;
private:
dirfrag_t subtree;
@ -42,9 +39,9 @@ private:
protected:
MDentryLink() :
Message(MSG_MDS_DENTRYLINK) { }
MessageInstance(MSG_MDS_DENTRYLINK) { }
MDentryLink(dirfrag_t r, dirfrag_t df, std::string_view n, bool p) :
Message(MSG_MDS_DENTRYLINK),
MessageInstance(MSG_MDS_DENTRYLINK),
subtree(r),
dirfrag(df),
dn(n),

View File

@ -20,11 +20,8 @@
#include "msg/Message.h"
class MDentryUnlink : public Message {
class MDentryUnlink : public MessageInstance<MDentryUnlink> {
public:
typedef boost::intrusive_ptr<MDentryUnlink> ref;
typedef boost::intrusive_ptr<MDentryUnlink const> const_ref;
using factory = MessageFactory<MDentryUnlink>;
friend factory;
private:
@ -40,9 +37,9 @@ private:
protected:
MDentryUnlink() :
Message(MSG_MDS_DENTRYUNLINK) { }
MessageInstance(MSG_MDS_DENTRYUNLINK) { }
MDentryUnlink(dirfrag_t df, std::string_view n) :
Message(MSG_MDS_DENTRYUNLINK),
MessageInstance(MSG_MDS_DENTRYUNLINK),
dirfrag(df),
dn(n) {}
~MDentryUnlink() override {}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
class MDirUpdate : public Message {
class MDirUpdate : public MessageInstance<MDirUpdate> {
public:
typedef boost::intrusive_ptr<MDirUpdate> ref;
typedef boost::intrusive_ptr<MDirUpdate const> const_ref;
using factory = MessageFactory<MDirUpdate>;
friend factory;
mds_rank_t get_source_mds() const { return from_mds; }
@ -62,19 +59,19 @@ public:
protected:
~MDirUpdate() {}
MDirUpdate() : Message(MSG_MDS_DIRUPDATE) {}
MDirUpdate() : MessageInstance(MSG_MDS_DIRUPDATE) {}
MDirUpdate(mds_rank_t f,
dirfrag_t dirfrag,
int dir_rep,
const std::set<int32_t>& dir_rep_by,
filepath& path,
bool discover = false) :
Message(MSG_MDS_DIRUPDATE), from_mds(f), dirfrag(dirfrag),
MessageInstance(MSG_MDS_DIRUPDATE), from_mds(f), dirfrag(dirfrag),
dir_rep(dir_rep), dir_rep_by(dir_rep_by), path(path) {
this->discover = discover ? 5 : 0;
}
MDirUpdate(const MDirUpdate& m)
: Message(MSG_MDS_DIRUPDATE),
: MessageInstance(MSG_MDS_DIRUPDATE),
from_mds(m.from_mds),
dirfrag(m.dirfrag),
dir_rep(m.dir_rep),

View File

@ -22,11 +22,8 @@
#include <string>
class MDiscover : public Message {
class MDiscover : public MessageInstance<MDiscover> {
public:
typedef boost::intrusive_ptr<MDiscover> ref;
typedef boost::intrusive_ptr<MDiscover const> const_ref;
using factory = MessageFactory<MDiscover>;
friend factory;
private:
@ -53,14 +50,14 @@ private:
void set_base_dir_frag(frag_t f) { base_dir_frag = f; }
protected:
MDiscover() : Message(MSG_MDS_DISCOVER) { }
MDiscover() : MessageInstance(MSG_MDS_DISCOVER) { }
MDiscover(inodeno_t base_ino_,
frag_t base_frag_,
snapid_t s,
filepath& want_path_,
bool want_base_dir_ = true,
bool discover_xlocks_ = false) :
Message(MSG_MDS_DISCOVER),
MessageInstance(MSG_MDS_DISCOVER),
base_ino(base_ino_),
base_dir_frag(base_frag_),
snapid(s),

View File

@ -63,11 +63,8 @@
*
*/
class MDiscoverReply : public Message {
class MDiscoverReply : public MessageInstance<MDiscoverReply> {
public:
typedef boost::intrusive_ptr<MDiscoverReply> ref;
typedef boost::intrusive_ptr<MDiscoverReply const> const_ref;
using factory = MessageFactory<MDiscoverReply>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -114,9 +111,9 @@ private:
void set_base_dir_frag(frag_t df) { base_dir_frag = df; }
protected:
MDiscoverReply() : Message(MSG_MDS_DISCOVERREPLY, HEAD_VERSION) { }
MDiscoverReply() : MessageInstance(MSG_MDS_DISCOVERREPLY, HEAD_VERSION) { }
MDiscoverReply(const MDiscover &dis) :
Message(MSG_MDS_DISCOVERREPLY, HEAD_VERSION),
MessageInstance(MSG_MDS_DISCOVERREPLY, HEAD_VERSION),
base_ino(dis.get_base_ino()),
base_dir_frag(dis.get_base_dir_frag()),
wanted_base_dir(dis.wants_base_dir()),
@ -131,7 +128,7 @@ protected:
header.tid = dis.get_tid();
}
MDiscoverReply(dirfrag_t df) :
Message(MSG_MDS_DISCOVERREPLY, HEAD_VERSION),
MessageInstance(MSG_MDS_DISCOVERREPLY, HEAD_VERSION),
base_ino(df.ino),
base_dir_frag(df.frag),
wanted_base_dir(false),

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
class MExportCaps : public Message {
class MExportCaps : public MessageInstance<MExportCaps> {
public:
typedef boost::intrusive_ptr<MExportCaps> ref;
typedef boost::intrusive_ptr<MExportCaps const> const_ref;
using factory = MessageFactory<MExportCaps>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -36,7 +33,7 @@ private:
protected:
MExportCaps() :
Message(MSG_MDS_EXPORTCAPS, HEAD_VERSION, COMPAT_VERSION) {}
MessageInstance(MSG_MDS_EXPORTCAPS, HEAD_VERSION, COMPAT_VERSION) {}
~MExportCaps() override {}
public:

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
class MExportCapsAck : public Message {
class MExportCapsAck : public MessageInstance<MExportCapsAck> {
public:
typedef boost::intrusive_ptr<MExportCapsAck> ref;
typedef boost::intrusive_ptr<MExportCapsAck const> const_ref;
using factory = MessageFactory<MExportCapsAck>;
friend factory;
inodeno_t ino;
@ -31,9 +28,9 @@ public:
protected:
MExportCapsAck() :
Message(MSG_MDS_EXPORTCAPSACK) {}
MessageInstance(MSG_MDS_EXPORTCAPSACK) {}
MExportCapsAck(inodeno_t i) :
Message(MSG_MDS_EXPORTCAPSACK), ino(i) {}
MessageInstance(MSG_MDS_EXPORTCAPSACK), ino(i) {}
~MExportCapsAck() override {}
public:

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
class MExportDir : public Message {
class MExportDir : public MessageInstance<MExportDir> {
public:
typedef boost::intrusive_ptr<MExportDir>ref;
typedef boost::intrusive_ptr<MExportDir const> const_ref;
using factory = MessageFactory<MExportDir>;
friend factory;
dirfrag_t dirfrag;
bufferlist export_data;
@ -31,9 +28,9 @@ public:
bufferlist client_map;
protected:
MExportDir() : Message(MSG_MDS_EXPORTDIR) {}
MExportDir() : MessageInstance(MSG_MDS_EXPORTDIR) {}
MExportDir(dirfrag_t df, uint64_t tid) :
Message(MSG_MDS_EXPORTDIR), dirfrag(df) {
MessageInstance(MSG_MDS_EXPORTDIR), dirfrag(df) {
set_tid(tid);
}
~MExportDir() override {}

View File

@ -18,11 +18,8 @@
#include "MExportDir.h"
#include "msg/Message.h"
class MExportDirAck : public Message {
class MExportDirAck : public MessageInstance<MExportDirAck> {
public:
typedef boost::intrusive_ptr<MExportDirAck> ref;
typedef boost::intrusive_ptr<MExportDirAck const> const_ref;
using factory = MessageFactory<MExportDirAck>;
friend factory;
dirfrag_t dirfrag;
@ -31,9 +28,9 @@ public:
dirfrag_t get_dirfrag() const { return dirfrag; }
protected:
MExportDirAck() : Message(MSG_MDS_EXPORTDIRACK) {}
MExportDirAck() : MessageInstance(MSG_MDS_EXPORTDIRACK) {}
MExportDirAck(dirfrag_t df, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRACK), dirfrag(df) {
MessageInstance(MSG_MDS_EXPORTDIRACK), dirfrag(df) {
set_tid(tid);
}
~MExportDirAck() override {}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "include/types.h"
class MExportDirCancel : public Message {
class MExportDirCancel : public MessageInstance<MExportDirCancel> {
public:
typedef boost::intrusive_ptr<MExportDirCancel> ref;
typedef boost::intrusive_ptr<MExportDirCancel const> const_ref;
using factory = MessageFactory<MExportDirCancel>;
friend factory;
private:
dirfrag_t dirfrag;
@ -31,9 +28,9 @@ private:
dirfrag_t get_dirfrag() const { return dirfrag; }
protected:
MExportDirCancel() : Message(MSG_MDS_EXPORTDIRCANCEL) {}
MExportDirCancel() : MessageInstance(MSG_MDS_EXPORTDIRCANCEL) {}
MExportDirCancel(dirfrag_t df, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRCANCEL), dirfrag(df) {
MessageInstance(MSG_MDS_EXPORTDIRCANCEL), dirfrag(df) {
set_tid(tid);
}
~MExportDirCancel() override {}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "include/types.h"
class MExportDirDiscover : public Message {
class MExportDirDiscover : public MessageInstance<MExportDirDiscover> {
public:
typedef boost::intrusive_ptr<MExportDirDiscover> ref;
typedef boost::intrusive_ptr<MExportDirDiscover const> const_ref;
using factory = MessageFactory<MExportDirDiscover>;
friend factory;
private:
mds_rank_t from = -1;
@ -39,10 +36,10 @@ private:
protected:
MExportDirDiscover() :
Message(MSG_MDS_EXPORTDIRDISCOVER),
MessageInstance(MSG_MDS_EXPORTDIRDISCOVER),
started(false) { }
MExportDirDiscover(dirfrag_t df, filepath& p, mds_rank_t f, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRDISCOVER),
MessageInstance(MSG_MDS_EXPORTDIRDISCOVER),
from(f), dirfrag(df), path(p), started(false) {
set_tid(tid);
}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "include/types.h"
class MExportDirDiscoverAck : public Message {
class MExportDirDiscoverAck : public MessageInstance<MExportDirDiscoverAck> {
public:
typedef boost::intrusive_ptr<MExportDirDiscoverAck> ref;
typedef boost::intrusive_ptr<MExportDirDiscoverAck const> const_ref;
using factory = MessageFactory<MExportDirDiscoverAck>;
friend factory;
private:
dirfrag_t dirfrag;
@ -34,9 +31,9 @@ private:
bool is_success() const { return success; }
protected:
MExportDirDiscoverAck() : Message(MSG_MDS_EXPORTDIRDISCOVERACK) {}
MExportDirDiscoverAck() : MessageInstance(MSG_MDS_EXPORTDIRDISCOVERACK) {}
MExportDirDiscoverAck(dirfrag_t df, uint64_t tid, bool s=true) :
Message(MSG_MDS_EXPORTDIRDISCOVERACK),
MessageInstance(MSG_MDS_EXPORTDIRDISCOVERACK),
dirfrag(df), success(s) {
set_tid(tid);
}

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MExportDirFinish : public Message {
class MExportDirFinish : public MessageInstance<MExportDirFinish> {
public:
typedef boost::intrusive_ptr<MExportDirFinish> ref;
typedef boost::intrusive_ptr<MExportDirFinish const> const_ref;
using factory = MessageFactory<MExportDirFinish>;
friend factory;
private:
dirfrag_t dirfrag;
@ -34,7 +31,7 @@ private:
protected:
MExportDirFinish() : last(false) {}
MExportDirFinish(dirfrag_t df, bool l, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRFINISH), dirfrag(df), last(l) {
MessageInstance(MSG_MDS_EXPORTDIRFINISH), dirfrag(df), last(l) {
set_tid(tid);
}
~MExportDirFinish() override {}

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MExportDirNotify : public Message {
class MExportDirNotify : public MessageInstance<MExportDirNotify> {
public:
typedef boost::intrusive_ptr<MExportDirNotify> ref;
typedef boost::intrusive_ptr<MExportDirNotify const> const_ref;
using factory = MessageFactory<MExportDirNotify>;
friend factory;
private:
dirfrag_t base;
@ -40,7 +37,7 @@ private:
protected:
MExportDirNotify() {}
MExportDirNotify(dirfrag_t i, uint64_t tid, bool a, pair<__s32,__s32> oa, pair<__s32,__s32> na) :
Message(MSG_MDS_EXPORTDIRNOTIFY),
MessageInstance(MSG_MDS_EXPORTDIRNOTIFY),
base(i), ack(a), old_auth(oa), new_auth(na) {
set_tid(tid);
}

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MExportDirNotifyAck : public Message {
class MExportDirNotifyAck : public MessageInstance<MExportDirNotifyAck> {
public:
typedef boost::intrusive_ptr<MExportDirNotifyAck>ref;
typedef boost::intrusive_ptr<MExportDirNotifyAck const> const_ref;
using factory = MessageFactory<MExportDirNotifyAck>;
friend factory;
private:
dirfrag_t dirfrag;
@ -34,7 +31,7 @@ private:
protected:
MExportDirNotifyAck() {}
MExportDirNotifyAck(dirfrag_t df, uint64_t tid, pair<__s32,__s32> na) :
Message(MSG_MDS_EXPORTDIRNOTIFYACK), dirfrag(df), new_auth(na) {
MessageInstance(MSG_MDS_EXPORTDIRNOTIFYACK), dirfrag(df), new_auth(na) {
set_tid(tid);
}
~MExportDirNotifyAck() override {}

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
#include "include/types.h"
class MExportDirPrep : public Message {
class MExportDirPrep : public MessageInstance<MExportDirPrep> {
public:
typedef boost::intrusive_ptr<MExportDirPrep> ref;
typedef boost::intrusive_ptr<MExportDirPrep const> const_ref;
using factory = MessageFactory<MExportDirPrep>;
friend factory;
private:
dirfrag_t dirfrag;
@ -48,7 +45,7 @@ protected:
b_did_assim = false;
}
MExportDirPrep(dirfrag_t df, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRPREP),
MessageInstance(MSG_MDS_EXPORTDIRPREP),
dirfrag(df), b_did_assim(false) {
set_tid(tid);
}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
#include "include/types.h"
class MExportDirPrepAck : public Message {
class MExportDirPrepAck : public MessageInstance<MExportDirPrepAck> {
public:
typedef boost::intrusive_ptr<MExportDirPrepAck> ref;
typedef boost::intrusive_ptr<MExportDirPrepAck const> const_ref;
using factory = MessageFactory<MExportDirPrepAck>;
friend factory;
private:
dirfrag_t dirfrag;
@ -34,7 +31,7 @@ private:
protected:
MExportDirPrepAck() {}
MExportDirPrepAck(dirfrag_t df, bool s, uint64_t tid) :
Message(MSG_MDS_EXPORTDIRPREPACK), dirfrag(df), success(s) {
MessageInstance(MSG_MDS_EXPORTDIRPREPACK), dirfrag(df), success(s) {
set_tid(tid);
}
~MExportDirPrepAck() override {}

View File

@ -20,11 +20,8 @@
#include "mds/FSMap.h"
#include "include/ceph_features.h"
class MFSMap : public Message {
class MFSMap : public MessageInstance<MFSMap> {
public:
typedef boost::intrusive_ptr<MFSMap> ref;
typedef boost::intrusive_ptr<MFSMap const> const_ref;
using factory = MessageFactory<MFSMap>;
friend factory;
epoch_t epoch;
@ -34,9 +31,9 @@ public:
const FSMap & get_fsmap() {return fsmap;}
MFSMap() :
Message(CEPH_MSG_FS_MAP), epoch(0) {}
MessageInstance(CEPH_MSG_FS_MAP), epoch(0) {}
MFSMap(const uuid_d &f, const FSMap &fsmap_) :
Message(CEPH_MSG_FS_MAP), epoch(fsmap_.get_epoch())
MessageInstance(CEPH_MSG_FS_MAP), epoch(fsmap_.get_epoch())
{
fsmap = fsmap_;
}

View File

@ -19,11 +19,8 @@
#include "mds/FSMapUser.h"
#include "include/ceph_features.h"
class MFSMapUser : public Message {
class MFSMapUser : public MessageInstance<MFSMapUser> {
public:
typedef boost::intrusive_ptr<MFSMapUser> ref;
typedef boost::intrusive_ptr<MFSMapUser const> const_ref;
using factory = MessageFactory<MFSMapUser>;
friend factory;
epoch_t epoch;
@ -32,9 +29,9 @@ public:
const FSMapUser & get_fsmap() { return fsmap; }
MFSMapUser() :
Message(CEPH_MSG_FS_MAP_USER), epoch(0) {}
MessageInstance(CEPH_MSG_FS_MAP_USER), epoch(0) {}
MFSMapUser(const uuid_d &f, const FSMapUser &fsmap_) :
Message(CEPH_MSG_FS_MAP_USER), epoch(fsmap_.epoch)
MessageInstance(CEPH_MSG_FS_MAP_USER), epoch(fsmap_.epoch)
{
fsmap = fsmap_;
}

View File

@ -24,11 +24,8 @@
#include "include/encoding.h"
#include "include/stringify.h"
class MForward : public Message {
class MForward : public MessageInstance<MForward> {
public:
typedef boost::intrusive_ptr<MForward> ref;
typedef boost::intrusive_ptr<MForward const> const_ref;
using factory = MessageFactory<MForward>;
friend factory;
uint64_t tid;
@ -45,11 +42,11 @@ public:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 4;
MForward() : Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
MForward() : MessageInstance(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
tid(0), con_features(0), msg(NULL) {}
//the message needs to have caps filled in!
MForward(uint64_t t, PaxosServiceMessage *m, uint64_t feat) :
Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
tid(t), msg(NULL) {
client_type = m->get_source().type();
client_addrs = m->get_source_addrs();
@ -64,7 +61,7 @@ public:
}
MForward(uint64_t t, PaxosServiceMessage *m, uint64_t feat,
const MonCap& caps) :
Message(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_FORWARD, HEAD_VERSION, COMPAT_VERSION),
tid(t), client_caps(caps), msg(NULL) {
client_type = m->get_source().type();
client_addrs = m->get_source_addrs();

View File

@ -4,11 +4,8 @@
#include "msg/Message.h"
class MGatherCaps : public Message {
class MGatherCaps : public MessageInstance<MGatherCaps> {
public:
typedef boost::intrusive_ptr<MGatherCaps> ref;
typedef boost::intrusive_ptr<MGatherCaps const> const_ref;
using factory = MessageFactory<MGatherCaps>;
friend factory;
@ -16,7 +13,7 @@ public:
protected:
MGatherCaps() :
Message(MSG_MDS_GATHERCAPS) {}
MessageInstance(MSG_MDS_GATHERCAPS) {}
~MGatherCaps() override {}
public:

View File

@ -18,18 +18,15 @@
#include "msg/Message.h"
class MGenericMessage : public Message {
class MGenericMessage : public MessageInstance<MGenericMessage> {
public:
typedef boost::intrusive_ptr<MGenericMessage> ref;
typedef boost::intrusive_ptr<MGenericMessage const> const_ref;
using factory = MessageFactory<MGenericMessage>;
friend factory;
private:
char tname[20];
//long pcid;
public:
MGenericMessage(int t=0) : Message(t) {
MGenericMessage(int t=0) : MessageInstance(t) {
snprintf(tname, sizeof(tname), "generic%d", get_type());
}

View File

@ -5,11 +5,8 @@
#include "msg/Message.h"
class MGetConfig : public Message {
class MGetConfig : public MessageInstance<MGetConfig> {
public:
typedef boost::intrusive_ptr<MGetConfig> ref;
typedef boost::intrusive_ptr<MGetConfig const> const_ref;
using factory = MessageFactory<MGetConfig>;
friend factory;
static const int HEAD_VERSION = 1;
@ -19,9 +16,9 @@ public:
string host; ///< our hostname
string device_class;
MGetConfig() : Message(MSG_GET_CONFIG, HEAD_VERSION, COMPAT_VERSION) { }
MGetConfig() : MessageInstance(MSG_GET_CONFIG, HEAD_VERSION, COMPAT_VERSION) { }
MGetConfig(const EntityName& n, const string& h)
: Message(MSG_GET_CONFIG, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_GET_CONFIG, HEAD_VERSION, COMPAT_VERSION),
name(n),
host(h) {}

View File

@ -18,19 +18,16 @@
#include "messages/PaxosServiceMessage.h"
class MGetPoolStats : public PaxosServiceMessage {
class MGetPoolStats : public MessageInstance<MGetPoolStats, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MGetPoolStats> ref;
typedef boost::intrusive_ptr<MGetPoolStats const> const_ref;
using factory = MessageFactory<MGetPoolStats>;
friend factory;
uuid_d fsid;
list<string> pools;
MGetPoolStats() : PaxosServiceMessage(MSG_GETPOOLSTATS, 0) {}
MGetPoolStats() : MessageInstance(MSG_GETPOOLSTATS, 0) {}
MGetPoolStats(const uuid_d& f, ceph_tid_t t, list<string>& ls, version_t l) :
PaxosServiceMessage(MSG_GETPOOLSTATS, l),
MessageInstance(MSG_GETPOOLSTATS, l),
fsid(f), pools(ls) {
set_tid(t);
}

View File

@ -16,19 +16,16 @@
#ifndef CEPH_MGETPOOLSTATSREPLY_H
#define CEPH_MGETPOOLSTATSREPLY_H
class MGetPoolStatsReply : public PaxosServiceMessage {
class MGetPoolStatsReply : public MessageInstance<MGetPoolStatsReply, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MGetPoolStatsReply> ref;
typedef boost::intrusive_ptr<MGetPoolStatsReply const> const_ref;
using factory = MessageFactory<MGetPoolStatsReply>;
friend factory;
uuid_d fsid;
map<string,pool_stat_t> pool_stats;
MGetPoolStatsReply() : PaxosServiceMessage(MSG_GETPOOLSTATSREPLY, 0) {}
MGetPoolStatsReply() : MessageInstance(MSG_GETPOOLSTATSREPLY, 0) {}
MGetPoolStatsReply(uuid_d& f, ceph_tid_t t, version_t v) :
PaxosServiceMessage(MSG_GETPOOLSTATSREPLY, v),
MessageInstance(MSG_GETPOOLSTATSREPLY, v),
fsid(f) {
set_tid(t);
}

View File

@ -20,11 +20,8 @@
#include "msg/Message.h"
#include "common/DecayCounter.h"
class MHeartbeat : public Message {
class MHeartbeat : public MessageInstance<MHeartbeat> {
public:
typedef boost::intrusive_ptr<MHeartbeat> ref;
typedef boost::intrusive_ptr<MHeartbeat const> const_ref;
using factory = MessageFactory<MHeartbeat>;
friend factory;
private:
mds_load_t load;
@ -39,9 +36,9 @@ private:
map<mds_rank_t, float>& get_import_map() { return import_map; }
protected:
MHeartbeat() : Message(MSG_MDS_HEARTBEAT), load(DecayRate()) {}
MHeartbeat() : MessageInstance(MSG_MDS_HEARTBEAT), load(DecayRate()) {}
MHeartbeat(mds_load_t& load, int beat)
: Message(MSG_MDS_HEARTBEAT),
: MessageInstance(MSG_MDS_HEARTBEAT),
load(load) {
this->beat = beat;
}

View File

@ -18,11 +18,8 @@
#include "msg/Message.h"
class MInodeFileCaps : public Message {
class MInodeFileCaps : public MessageInstance<MInodeFileCaps> {
public:
typedef boost::intrusive_ptr<MInodeFileCaps> ref;
typedef boost::intrusive_ptr<MInodeFileCaps const> const_ref;
using factory = MessageFactory<MInodeFileCaps>;
friend factory;
private:
inodeno_t ino;
@ -34,9 +31,9 @@ private:
int get_caps() const { return caps; }
protected:
MInodeFileCaps() : Message(MSG_MDS_INODEFILECAPS) {}
MInodeFileCaps() : MessageInstance(MSG_MDS_INODEFILECAPS) {}
MInodeFileCaps(inodeno_t ino, int caps) :
Message(MSG_MDS_INODEFILECAPS) {
MessageInstance(MSG_MDS_INODEFILECAPS) {
this->ino = ino;
this->caps = caps;
}

View File

@ -20,11 +20,8 @@
#include "mds/locks.h"
#include "mds/SimpleLock.h"
class MLock : public Message {
class MLock : public MessageInstance<MLock> {
public:
typedef boost::intrusive_ptr<MLock> ref;
typedef boost::intrusive_ptr<MLock const> const_ref;
using factory = MessageFactory<MLock>;
friend factory;
private:
int32_t action = 0; // action type
@ -48,19 +45,19 @@ public:
MDSCacheObjectInfo &get_object_info() { return object_info; }
protected:
MLock() : Message(MSG_MDS_LOCK) {}
MLock() : MessageInstance(MSG_MDS_LOCK) {}
MLock(int ac, mds_rank_t as) :
Message(MSG_MDS_LOCK),
MessageInstance(MSG_MDS_LOCK),
action(ac), asker(as),
lock_type(0) { }
MLock(SimpleLock *lock, int ac, mds_rank_t as) :
Message(MSG_MDS_LOCK),
MessageInstance(MSG_MDS_LOCK),
action(ac), asker(as),
lock_type(lock->get_type()) {
lock->get_parent()->set_object_info(object_info);
}
MLock(SimpleLock *lock, int ac, mds_rank_t as, bufferlist& bl) :
Message(MSG_MDS_LOCK),
MessageInstance(MSG_MDS_LOCK),
action(ac), asker(as), lock_type(lock->get_type()) {
lock->get_parent()->set_object_info(object_info);
lockdata.claim(bl);

View File

@ -20,20 +20,17 @@
#include <deque>
class MLog : public PaxosServiceMessage {
class MLog : public MessageInstance<MLog, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MLog> ref;
typedef boost::intrusive_ptr<MLog const> const_ref;
using factory = MessageFactory<MLog>;
friend factory;
uuid_d fsid;
std::deque<LogEntry> entries;
MLog() : PaxosServiceMessage(MSG_LOG, 0) {}
MLog() : MessageInstance(MSG_LOG, 0) {}
MLog(const uuid_d& f, const std::deque<LogEntry>& e)
: PaxosServiceMessage(MSG_LOG, 0), fsid(f), entries(e) { }
MLog(const uuid_d& f) : PaxosServiceMessage(MSG_LOG, 0), fsid(f) { }
: MessageInstance(MSG_LOG, 0), fsid(f), entries(e) { }
MLog(const uuid_d& f) : MessageInstance(MSG_LOG, 0), fsid(f) { }
private:
~MLog() override {}

View File

@ -15,19 +15,16 @@
#ifndef CEPH_MLOGACK_H
#define CEPH_MLOGACK_H
class MLogAck : public Message {
class MLogAck : public MessageInstance<MLogAck> {
public:
typedef boost::intrusive_ptr<MLogAck> ref;
typedef boost::intrusive_ptr<MLogAck const> const_ref;
using factory = MessageFactory<MLogAck>;
friend factory;
uuid_d fsid;
version_t last = 0;
std::string channel;
MLogAck() : Message(MSG_LOGACK) {}
MLogAck(uuid_d& f, version_t l) : Message(MSG_LOGACK), fsid(f), last(l) {}
MLogAck() : MessageInstance(MSG_LOGACK) {}
MLogAck(uuid_d& f, version_t l) : MessageInstance(MSG_LOGACK), fsid(f), last(l) {}
private:
~MLogAck() override {}

View File

@ -179,11 +179,8 @@ struct MDSHealth
WRITE_CLASS_ENCODER(MDSHealth)
class MMDSBeacon : public PaxosServiceMessage {
class MMDSBeacon : public MessageInstance<MMDSBeacon, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMDSBeacon> ref;
typedef boost::intrusive_ptr<MMDSBeacon const> const_ref;
using factory = MessageFactory<MMDSBeacon>;
friend factory;
private:
@ -212,14 +209,14 @@ private:
protected:
MMDSBeacon()
: PaxosServiceMessage(MSG_MDS_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MDS_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
global_id(0), state(MDSMap::STATE_NULL), standby_for_rank(MDS_RANK_NONE),
standby_for_fscid(FS_CLUSTER_ID_NONE), standby_replay(false),
mds_features(0) {
set_priority(CEPH_MSG_PRIO_HIGH);
}
MMDSBeacon(const uuid_d &f, mds_gid_t g, const string& n, epoch_t les, MDSMap::DaemonState st, version_t se, uint64_t feat) :
PaxosServiceMessage(MSG_MDS_BEACON, les, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_MDS_BEACON, les, HEAD_VERSION, COMPAT_VERSION),
fsid(f), global_id(g), name(n), state(st), seq(se),
standby_for_rank(MDS_RANK_NONE), standby_for_fscid(FS_CLUSTER_ID_NONE),
standby_replay(false), mds_features(feat) {

View File

@ -27,11 +27,8 @@
// sent from replica to auth
class MMDSCacheRejoin : public Message {
class MMDSCacheRejoin : public MessageInstance<MMDSCacheRejoin> {
public:
typedef boost::intrusive_ptr<MMDSCacheRejoin> ref;
typedef boost::intrusive_ptr<MMDSCacheRejoin const> const_ref;
using factory = MessageFactory<MMDSCacheRejoin>;
friend factory;
private:
@ -219,10 +216,10 @@ private:
protected:
MMDSCacheRejoin() :
Message(MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION),
op(0) {}
MMDSCacheRejoin(int o) :
Message(MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_MDS_CACHEREJOIN, HEAD_VERSION, COMPAT_VERSION),
op(o) {}
~MMDSCacheRejoin() override {}

View File

@ -18,19 +18,16 @@
#include "msg/Message.h"
#include "include/filepath.h"
class MMDSFindIno : public Message {
class MMDSFindIno : public MessageInstance<MMDSFindIno> {
public:
typedef boost::intrusive_ptr<MMDSFindIno> ref;
typedef boost::intrusive_ptr<MMDSFindIno const> const_ref;
using factory = MessageFactory<MMDSFindIno>;
friend factory;
ceph_tid_t tid {0};
inodeno_t ino;
protected:
MMDSFindIno() : Message(MSG_MDS_FINDINO) {}
MMDSFindIno(ceph_tid_t t, inodeno_t i) : Message(MSG_MDS_FINDINO), tid(t), ino(i) {}
MMDSFindIno() : MessageInstance(MSG_MDS_FINDINO) {}
MMDSFindIno(ceph_tid_t t, inodeno_t i) : MessageInstance(MSG_MDS_FINDINO), tid(t), ino(i) {}
~MMDSFindIno() override {}
public:

View File

@ -18,19 +18,16 @@
#include "msg/Message.h"
#include "include/filepath.h"
class MMDSFindInoReply : public Message {
class MMDSFindInoReply : public MessageInstance<MMDSFindInoReply> {
public:
typedef boost::intrusive_ptr<MMDSFindInoReply> ref;
typedef boost::intrusive_ptr<MMDSFindInoReply const> const_ref;
using factory = MessageFactory<MMDSFindInoReply>;
friend factory;
ceph_tid_t tid = 0;
filepath path;
protected:
MMDSFindInoReply() : Message(MSG_MDS_FINDINOREPLY) {}
MMDSFindInoReply(ceph_tid_t t) : Message(MSG_MDS_FINDINOREPLY), tid(t) {}
MMDSFindInoReply() : MessageInstance(MSG_MDS_FINDINOREPLY) {}
MMDSFindInoReply(ceph_tid_t t) : MessageInstance(MSG_MDS_FINDINOREPLY), tid(t) {}
~MMDSFindInoReply() override {}
public:

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MMDSFragmentNotify : public Message {
class MMDSFragmentNotify : public MessageInstance<MMDSFragmentNotify> {
public:
typedef boost::intrusive_ptr<MMDSFragmentNotify> ref;
typedef boost::intrusive_ptr<MMDSFragmentNotify const> const_ref;
using factory = MessageFactory<MMDSFragmentNotify>;
friend factory;
private:
inodeno_t ino;
@ -36,9 +33,9 @@ private:
bufferlist basebl;
protected:
MMDSFragmentNotify() : Message(MSG_MDS_FRAGMENTNOTIFY) {}
MMDSFragmentNotify() : MessageInstance(MSG_MDS_FRAGMENTNOTIFY) {}
MMDSFragmentNotify(dirfrag_t df, int b) :
Message(MSG_MDS_FRAGMENTNOTIFY),
MessageInstance(MSG_MDS_FRAGMENTNOTIFY),
ino(df.ino), basefrag(df.frag), bits(b) { }
~MMDSFragmentNotify() override {}

View File

@ -23,20 +23,17 @@
#include <map>
using std::map;
class MMDSLoadTargets : public PaxosServiceMessage {
class MMDSLoadTargets : public MessageInstance<MMDSLoadTargets, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMDSLoadTargets> ref;
typedef boost::intrusive_ptr<MMDSLoadTargets const> const_ref;
using factory = MessageFactory<MMDSLoadTargets>;
friend factory;
mds_gid_t global_id;
set<mds_rank_t> targets;
protected:
MMDSLoadTargets() : PaxosServiceMessage(MSG_MDS_OFFLOAD_TARGETS, 0) {}
MMDSLoadTargets() : MessageInstance(MSG_MDS_OFFLOAD_TARGETS, 0) {}
MMDSLoadTargets(mds_gid_t g, set<mds_rank_t>& mds_targets) :
PaxosServiceMessage(MSG_MDS_OFFLOAD_TARGETS, 0),
MessageInstance(MSG_MDS_OFFLOAD_TARGETS, 0),
global_id(g), targets(mds_targets) {}
~MMDSLoadTargets() override {}

View File

@ -20,11 +20,8 @@
#include "mds/MDSMap.h"
#include "include/ceph_features.h"
class MMDSMap : public Message {
class MMDSMap : public MessageInstance<MMDSMap> {
public:
typedef boost::intrusive_ptr<MMDSMap> ref;
typedef boost::intrusive_ptr<MMDSMap const> const_ref;
using factory = MessageFactory<MMDSMap>;
friend factory;
private:
@ -40,9 +37,9 @@ public:
protected:
MMDSMap() :
Message(CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION) {}
MessageInstance(CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION) {}
MMDSMap(const uuid_d &f, const MDSMap &mm) :
Message(CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(CEPH_MSG_MDS_MAP, HEAD_VERSION, COMPAT_VERSION),
fsid(f) {
epoch = mm.get_epoch();
mm.encode(encoded, -1); // we will reencode with fewer features as necessary

View File

@ -17,20 +17,17 @@
#include "msg/Message.h"
class MMDSOpenIno : public Message {
class MMDSOpenIno : public MessageInstance<MMDSOpenIno> {
public:
typedef boost::intrusive_ptr<MMDSOpenIno> ref;
typedef boost::intrusive_ptr<MMDSOpenIno const> const_ref;
using factory = MessageFactory<MMDSOpenIno>;
friend factory;
inodeno_t ino;
vector<inode_backpointer_t> ancestors;
protected:
MMDSOpenIno() : Message(MSG_MDS_OPENINO) {}
MMDSOpenIno() : MessageInstance(MSG_MDS_OPENINO) {}
MMDSOpenIno(ceph_tid_t t, inodeno_t i, vector<inode_backpointer_t>* pa) :
Message(MSG_MDS_OPENINO), ino(i) {
MessageInstance(MSG_MDS_OPENINO), ino(i) {
header.tid = t;
if (pa)
ancestors = *pa;

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MMDSOpenInoReply : public Message {
class MMDSOpenInoReply : public MessageInstance<MMDSOpenInoReply> {
public:
typedef boost::intrusive_ptr<MMDSOpenInoReply> ref;
typedef boost::intrusive_ptr<MMDSOpenInoReply const> const_ref;
using factory = MessageFactory<MMDSOpenInoReply>;
friend factory;
inodeno_t ino;
@ -30,9 +27,9 @@ public:
int32_t error;
protected:
MMDSOpenInoReply() : Message(MSG_MDS_OPENINOREPLY), error(0) {}
MMDSOpenInoReply() : MessageInstance(MSG_MDS_OPENINOREPLY), error(0) {}
MMDSOpenInoReply(ceph_tid_t t, inodeno_t i, mds_rank_t h=MDS_RANK_NONE, int e=0) :
Message(MSG_MDS_OPENINOREPLY), ino(i), hint(h), error(e) {
MessageInstance(MSG_MDS_OPENINOREPLY), ino(i), hint(h), error(e) {
header.tid = t;
}

View File

@ -19,11 +19,8 @@
#include "include/types.h"
class MMDSResolve : public Message {
class MMDSResolve : public MessageInstance<MMDSResolve> {
public:
typedef boost::intrusive_ptr<MMDSResolve> ref;
typedef boost::intrusive_ptr<MMDSResolve const> const_ref;
using factory = MessageFactory<MMDSResolve>;
friend factory;
map<dirfrag_t, vector<dirfrag_t> > subtrees;
@ -71,7 +68,7 @@ public:
list<table_client> table_clients;
protected:
MMDSResolve() : Message(MSG_MDS_RESOLVE) {}
MMDSResolve() : MessageInstance(MSG_MDS_RESOLVE) {}
~MMDSResolve() override {}
public:

View File

@ -20,18 +20,15 @@
#include "include/types.h"
class MMDSResolveAck : public Message {
class MMDSResolveAck : public MessageInstance<MMDSResolveAck> {
public:
typedef boost::intrusive_ptr<MMDSResolveAck> ref;
typedef boost::intrusive_ptr<MMDSResolveAck const> const_ref;
using factory = MessageFactory<MMDSResolveAck>;
friend factory;
map<metareqid_t, bufferlist> commit;
vector<metareqid_t> abort;
protected:
MMDSResolveAck() : Message(MSG_MDS_RESOLVEACK) {}
MMDSResolveAck() : MessageInstance(MSG_MDS_RESOLVEACK) {}
~MMDSResolveAck() override {}
public:

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
#include "mds/mdstypes.h"
class MMDSSlaveRequest : public Message {
class MMDSSlaveRequest : public MessageInstance<MMDSSlaveRequest> {
public:
typedef boost::intrusive_ptr<MMDSSlaveRequest> ref;
typedef boost::intrusive_ptr<MMDSSlaveRequest const> const_ref;
using factory = MessageFactory<MMDSSlaveRequest>;
friend factory;
static const int OP_XLOCK = 1;
@ -161,9 +158,9 @@ public:
bufferlist& get_lock_data() { return inode_export; }
protected:
MMDSSlaveRequest() : Message(MSG_MDS_SLAVE_REQUEST) { }
MMDSSlaveRequest() : MessageInstance(MSG_MDS_SLAVE_REQUEST) { }
MMDSSlaveRequest(metareqid_t ri, __u32 att, int o) :
Message(MSG_MDS_SLAVE_REQUEST),
MessageInstance(MSG_MDS_SLAVE_REQUEST),
reqid(ri), attempt(att), op(o), flags(0), lock_type(0),
inode_export_v(0), srcdn_auth(MDS_RANK_NONE) { }
~MMDSSlaveRequest() override {}

View File

@ -17,11 +17,8 @@
#include "msg/Message.h"
class MMDSSnapUpdate : public Message {
class MMDSSnapUpdate : public MessageInstance<MMDSSnapUpdate> {
public:
typedef boost::intrusive_ptr<MMDSSnapUpdate> ref;
typedef boost::intrusive_ptr<MMDSSnapUpdate const> const_ref;
using factory = MessageFactory<MMDSSnapUpdate>;
friend factory;
private:
@ -35,9 +32,9 @@ public:
bufferlist snap_blob;
protected:
MMDSSnapUpdate() : Message(MSG_MDS_SNAPUPDATE) {}
MMDSSnapUpdate() : MessageInstance(MSG_MDS_SNAPUPDATE) {}
MMDSSnapUpdate(inodeno_t i, version_t tid, int op) :
Message(MSG_MDS_SNAPUPDATE), ino(i), snap_op(op) {
MessageInstance(MSG_MDS_SNAPUPDATE), ino(i), snap_op(op) {
set_tid(tid);
}
~MMDSSnapUpdate() override {}

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
#include "mds/mds_table_types.h"
class MMDSTableRequest : public Message {
class MMDSTableRequest : public MessageInstance<MMDSTableRequest> {
public:
typedef boost::intrusive_ptr<MMDSTableRequest> ref;
typedef boost::intrusive_ptr<MMDSTableRequest const> const_ref;
using factory = MessageFactory<MMDSTableRequest>;
friend factory;
__u16 table = 0;
@ -32,9 +29,9 @@ public:
bufferlist bl;
protected:
MMDSTableRequest() : Message(MSG_MDS_TABLE_REQUEST) {}
MMDSTableRequest() : MessageInstance(MSG_MDS_TABLE_REQUEST) {}
MMDSTableRequest(int tab, int o, uint64_t r, version_t v=0) :
Message(MSG_MDS_TABLE_REQUEST),
MessageInstance(MSG_MDS_TABLE_REQUEST),
table(tab), op(o), reqid(r) {
set_tid(v);
}

View File

@ -22,11 +22,8 @@
#include "include/types.h"
class MMgrBeacon : public PaxosServiceMessage {
class MMgrBeacon : public MessageInstance<MMgrBeacon, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMgrBeacon> ref;
typedef boost::intrusive_ptr<MMgrBeacon const> const_ref;
using factory = MessageFactory<MMgrBeacon>;
friend factory;
private:
@ -53,7 +50,7 @@ protected:
public:
MMgrBeacon()
: PaxosServiceMessage(MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
gid(0), available(false)
{
}
@ -62,7 +59,7 @@ public:
entity_addrvec_t server_addrs_, bool available_,
std::vector<MgrMap::ModuleInfo>&& modules_,
map<string,string>&& metadata_)
: PaxosServiceMessage(MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
gid(gid_), server_addrs(server_addrs_), available(available_), name(name_),
fsid(fsid_), modules(std::move(modules_)), metadata(std::move(metadata_))
{

View File

@ -5,12 +5,8 @@
#include "msg/Message.h"
class MMgrClose : public Message
{
class MMgrClose : public MessageInstance<MMgrClose> {
public:
typedef boost::intrusive_ptr<MMgrClose> ref;
typedef boost::intrusive_ptr<MMgrClose const> const_ref;
using factory = MessageFactory<MMgrClose>;
friend factory;
private:
@ -47,6 +43,6 @@ public:
}
MMgrClose()
: Message(MSG_MGR_CLOSE, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MGR_CLOSE, HEAD_VERSION, COMPAT_VERSION)
{}
};

View File

@ -21,12 +21,8 @@
* This message is sent from ceph-mgr to MgrClient, instructing it
* it about what data to send back to ceph-mgr at what frequency.
*/
class MMgrConfigure : public Message
{
class MMgrConfigure : public MessageInstance<MMgrConfigure> {
public:
typedef boost::intrusive_ptr<MMgrConfigure> ref;
typedef boost::intrusive_ptr<MMgrConfigure const> const_ref;
using factory = MessageFactory<MMgrConfigure>;
friend factory;
private:
@ -61,7 +57,7 @@ public:
}
MMgrConfigure()
: Message(MSG_MGR_CONFIGURE, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MGR_CONFIGURE, HEAD_VERSION, COMPAT_VERSION)
{}
};

View File

@ -22,18 +22,15 @@
* The mgr digest is a way for the mgr to subscribe to things
* other than the cluster maps, which are needed by
*/
class MMgrDigest : public Message {
class MMgrDigest : public MessageInstance<MMgrDigest> {
public:
typedef boost::intrusive_ptr<MMgrDigest> ref;
typedef boost::intrusive_ptr<MMgrDigest const> const_ref;
using factory = MessageFactory<MMgrDigest>;
friend factory;
bufferlist mon_status_json;
bufferlist health_json;
MMgrDigest() :
Message(MSG_MGR_DIGEST) {}
MessageInstance(MSG_MGR_DIGEST) {}
const char *get_type_name() const override { return "mgrdigest"; }
void print(ostream& out) const override {

View File

@ -19,11 +19,8 @@
#include "msg/Message.h"
#include "mon/MgrMap.h"
class MMgrMap : public Message {
class MMgrMap : public MessageInstance<MMgrMap> {
public:
typedef boost::intrusive_ptr<MMgrMap> ref;
typedef boost::intrusive_ptr<MMgrMap const> const_ref;
using factory = MessageFactory<MMgrMap>;
friend factory;
protected:
@ -33,9 +30,9 @@ public:
const MgrMap & get_map() {return map;}
MMgrMap() :
Message(MSG_MGR_MAP) {}
MessageInstance(MSG_MGR_MAP) {}
MMgrMap(const MgrMap &map_) :
Message(MSG_MGR_MAP), map(map_)
MessageInstance(MSG_MGR_MAP), map(map_)
{
}

View File

@ -17,12 +17,8 @@
#include "msg/Message.h"
class MMgrOpen : public Message
{
class MMgrOpen : public MessageInstance<MMgrOpen> {
public:
typedef boost::intrusive_ptr<MMgrOpen> ref;
typedef boost::intrusive_ptr<MMgrOpen const> const_ref;
using factory = MessageFactory<MMgrOpen>;
friend factory;
private:
@ -91,7 +87,7 @@ public:
}
MMgrOpen()
: Message(MSG_MGR_OPEN, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MGR_OPEN, HEAD_VERSION, COMPAT_VERSION)
{}
};

View File

@ -70,12 +70,8 @@ public:
};
WRITE_CLASS_ENCODER(PerfCounterType)
class MMgrReport : public Message
{
class MMgrReport : public MessageInstance<MMgrReport> {
public:
typedef boost::intrusive_ptr<MMgrReport> ref;
typedef boost::intrusive_ptr<MMgrReport const> const_ref;
using factory = MessageFactory<MMgrReport>;
friend factory;
private:
@ -164,7 +160,7 @@ public:
}
MMgrReport()
: Message(MSG_MGR_REPORT, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MGR_REPORT, HEAD_VERSION, COMPAT_VERSION)
{}
};

View File

@ -20,19 +20,16 @@
#include <vector>
#include <string>
class MMonCommand : public PaxosServiceMessage {
class MMonCommand : public MessageInstance<MMonCommand, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonCommand> ref;
typedef boost::intrusive_ptr<MMonCommand const> const_ref;
using factory = MessageFactory<MMonCommand>;
friend factory;
uuid_d fsid;
std::vector<std::string> cmd;
MMonCommand() : PaxosServiceMessage(MSG_MON_COMMAND, 0) {}
MMonCommand() : MessageInstance(MSG_MON_COMMAND, 0) {}
MMonCommand(const uuid_d &f)
: PaxosServiceMessage(MSG_MON_COMMAND, 0),
: MessageInstance(MSG_MON_COMMAND, 0),
fsid(f)
{ }

View File

@ -17,20 +17,17 @@
#include "messages/PaxosServiceMessage.h"
class MMonCommandAck : public PaxosServiceMessage {
class MMonCommandAck : public MessageInstance<MMonCommandAck, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonCommandAck> ref;
typedef boost::intrusive_ptr<MMonCommandAck const> const_ref;
using factory = MessageFactory<MMonCommandAck>;
friend factory;
vector<string> cmd;
errorcode32_t r;
string rs;
MMonCommandAck() : PaxosServiceMessage(MSG_MON_COMMAND_ACK, 0) {}
MMonCommandAck() : MessageInstance(MSG_MON_COMMAND_ACK, 0) {}
MMonCommandAck(vector<string>& c, int _r, string s, version_t v) :
PaxosServiceMessage(MSG_MON_COMMAND_ACK, v),
MessageInstance(MSG_MON_COMMAND_ACK, v),
cmd(c), r(_r), rs(s) { }
private:
~MMonCommandAck() override {}

View File

@ -20,11 +20,8 @@
#include "mon/MonMap.h"
#include "mon/mon_types.h"
class MMonElection : public Message {
class MMonElection : public MessageInstance<MMonElection> {
public:
typedef boost::intrusive_ptr<MMonElection> ref;
typedef boost::intrusive_ptr<MMonElection const> const_ref;
using factory = MessageFactory<MMonElection>;
friend factory;
private:
@ -56,14 +53,14 @@ public:
bufferlist sharing_bl;
map<string,string> metadata;
MMonElection() : Message(MSG_MON_ELECTION, HEAD_VERSION, COMPAT_VERSION),
MMonElection() : MessageInstance(MSG_MON_ELECTION, HEAD_VERSION, COMPAT_VERSION),
op(0), epoch(0),
quorum_features(0),
mon_features(0)
{ }
MMonElection(int o, epoch_t e, MonMap *m)
: Message(MSG_MON_ELECTION, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_ELECTION, HEAD_VERSION, COMPAT_VERSION),
fsid(m->fsid), op(o), epoch(e),
quorum_features(0),
mon_features(0)

View File

@ -19,14 +19,11 @@
#include "include/types.h"
class MMonGetMap : public Message {
class MMonGetMap : public MessageInstance<MMonGetMap> {
public:
typedef boost::intrusive_ptr<MMonGetMap> ref;
typedef boost::intrusive_ptr<MMonGetMap const> const_ref;
using factory = MessageFactory<MMonGetMap>;
friend factory;
MMonGetMap() : Message(CEPH_MSG_MON_GET_MAP) { }
MMonGetMap() : MessageInstance(CEPH_MSG_MON_GET_MAP) { }
private:
~MMonGetMap() override {}

View File

@ -19,11 +19,8 @@
#include "include/types.h"
class MMonGetOSDMap : public PaxosServiceMessage {
class MMonGetOSDMap : public MessageInstance<MMonGetOSDMap, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonGetOSDMap> ref;
typedef boost::intrusive_ptr<MMonGetOSDMap const> const_ref;
using factory = MessageFactory<MMonGetOSDMap>;
friend factory;
private:
@ -32,7 +29,7 @@ private:
public:
MMonGetOSDMap()
: PaxosServiceMessage(CEPH_MSG_MON_GET_OSDMAP, 0),
: MessageInstance(CEPH_MSG_MON_GET_OSDMAP, 0),
full_first(0),
full_last(0),
inc_first(0),

View File

@ -25,14 +25,11 @@
* can be used to determine whether a pool actually does not exist, or
* if it may have been created but the map was not received yet.
*/
class MMonGetVersion : public Message {
class MMonGetVersion : public MessageInstance<MMonGetVersion> {
public:
typedef boost::intrusive_ptr<MMonGetVersion> ref;
typedef boost::intrusive_ptr<MMonGetVersion const> const_ref;
using factory = MessageFactory<MMonGetVersion>;
friend factory;
MMonGetVersion() : Message(CEPH_MSG_MON_GET_VERSION) {}
MMonGetVersion() : MessageInstance(CEPH_MSG_MON_GET_VERSION) {}
const char *get_type_name() const override {
return "mon_get_version";

View File

@ -24,17 +24,14 @@
* MMonGetVersion. The latest version of the requested thing is sent
* back.
*/
class MMonGetVersionReply : public Message {
class MMonGetVersionReply : public MessageInstance<MMonGetVersionReply> {
public:
typedef boost::intrusive_ptr<MMonGetVersionReply> ref;
typedef boost::intrusive_ptr<MMonGetVersionReply const> const_ref;
using factory = MessageFactory<MMonGetVersionReply>;
friend factory;
private:
static const int HEAD_VERSION = 2;
public:
MMonGetVersionReply() : Message(CEPH_MSG_MON_GET_VERSION_REPLY, HEAD_VERSION) { }
MMonGetVersionReply() : MessageInstance(CEPH_MSG_MON_GET_VERSION_REPLY, HEAD_VERSION) { }
const char *get_type_name() const override {
return "mon_get_version_reply";

View File

@ -17,15 +17,12 @@
#include "messages/PaxosServiceMessage.h"
class MMonGlobalID : public PaxosServiceMessage {
class MMonGlobalID : public MessageInstance<MMonGlobalID, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonGlobalID> ref;
typedef boost::intrusive_ptr<MMonGlobalID const> const_ref;
using factory = MessageFactory<MMonGlobalID>;
friend factory;
uint64_t old_max_id;
MMonGlobalID() : PaxosServiceMessage(MSG_MON_GLOBAL_ID, 0), old_max_id(0) { }
MMonGlobalID() : MessageInstance(MSG_MON_GLOBAL_ID, 0), old_max_id(0) { }
private:
~MMonGlobalID() override {}

View File

@ -18,11 +18,8 @@
#include "messages/MMonQuorumService.h"
#include "mon/mon_types.h"
class MMonHealth : public MMonQuorumService {
class MMonHealth : public MessageInstance<MMonHealth, MMonQuorumService> {
public:
typedef boost::intrusive_ptr<MMonHealth> ref;
typedef boost::intrusive_ptr<MMonHealth const> const_ref;
using factory = MessageFactory<MMonHealth>;
friend factory;
static const int HEAD_VERSION = 1;
@ -33,7 +30,7 @@ public:
// service specific data
DataStats data_stats;
MMonHealth() : MMonQuorumService(MSG_MON_HEALTH, HEAD_VERSION) { }
MMonHealth() : MessageInstance(MSG_MON_HEALTH, HEAD_VERSION) { }
private:
~MMonHealth() override { }

View File

@ -7,11 +7,8 @@
#include "messages/PaxosServiceMessage.h"
#include "mon/health_check.h"
class MMonHealthChecks : public PaxosServiceMessage {
class MMonHealthChecks : public MessageInstance<MMonHealthChecks, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonHealthChecks> ref;
typedef boost::intrusive_ptr<MMonHealthChecks const> const_ref;
using factory = MessageFactory<MMonHealthChecks>;
friend factory;
static const int HEAD_VERSION = 1;
@ -20,10 +17,10 @@ public:
health_check_map_t health_checks;
MMonHealthChecks()
: PaxosServiceMessage(MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION) {
: MessageInstance(MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION) {
}
MMonHealthChecks(health_check_map_t& m)
: PaxosServiceMessage(MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_HEALTH_CHECKS, HEAD_VERSION, COMPAT_VERSION),
health_checks(m) {
}

View File

@ -20,20 +20,17 @@
#include <vector>
using std::vector;
class MMonJoin : public PaxosServiceMessage {
class MMonJoin : public MessageInstance<MMonJoin, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonJoin> ref;
typedef boost::intrusive_ptr<MMonJoin const> const_ref;
using factory = MessageFactory<MMonJoin>;
friend factory;
uuid_d fsid;
string name;
entity_addr_t addr;
MMonJoin() : PaxosServiceMessage(MSG_MON_JOIN, 0) {}
MMonJoin() : MessageInstance(MSG_MON_JOIN, 0) {}
MMonJoin(uuid_d &f, string n, const entity_addr_t& a)
: PaxosServiceMessage(MSG_MON_JOIN, 0),
: MessageInstance(MSG_MON_JOIN, 0),
fsid(f), name(n), addr(a)
{ }

View File

@ -19,17 +19,14 @@
#include "msg/Message.h"
#include "mon/MonMap.h"
class MMonMap : public Message {
class MMonMap : public MessageInstance<MMonMap> {
public:
typedef boost::intrusive_ptr<MMonMap> ref;
typedef boost::intrusive_ptr<MMonMap const> const_ref;
using factory = MessageFactory<MMonMap>;
friend factory;
bufferlist monmapbl;
MMonMap() : Message(CEPH_MSG_MON_MAP) { }
explicit MMonMap(bufferlist &bl) : Message(CEPH_MSG_MON_MAP) {
MMonMap() : MessageInstance(CEPH_MSG_MON_MAP) { }
explicit MMonMap(bufferlist &bl) : MessageInstance(CEPH_MSG_MON_MAP) {
monmapbl.claim(bl);
}
private:

View File

@ -18,11 +18,8 @@
#include "mon/mon_types.h"
#include "msg/Message.h"
class MMonMetadata : public Message {
class MMonMetadata : public MessageInstance<MMonMetadata> {
public:
typedef boost::intrusive_ptr<MMonMetadata> ref;
typedef boost::intrusive_ptr<MMonMetadata const> const_ref;
using factory = MessageFactory<MMonMetadata>;
friend factory;
Metadata data;
@ -33,10 +30,10 @@ private:
public:
MMonMetadata() :
Message(CEPH_MSG_MON_METADATA)
MessageInstance(CEPH_MSG_MON_METADATA)
{}
MMonMetadata(const Metadata& metadata) :
Message(CEPH_MSG_MON_METADATA, HEAD_VERSION),
MessageInstance(CEPH_MSG_MON_METADATA, HEAD_VERSION),
data(metadata)
{}

View File

@ -20,11 +20,8 @@
#include "include/health.h"
#include "mon/health_check.h"
class MMonMgrReport : public PaxosServiceMessage {
class MMonMgrReport : public MessageInstance<MMonMgrReport, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MMonMgrReport> ref;
typedef boost::intrusive_ptr<MMonMgrReport const> const_ref;
using factory = MessageFactory<MMonMgrReport>;
friend factory;
private:
static const int HEAD_VERSION = 1;
@ -36,7 +33,7 @@ public:
bufferlist service_map_bl; // encoded ServiceMap
MMonMgrReport()
: PaxosServiceMessage(MSG_MON_MGR_REPORT, 0, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MON_MGR_REPORT, 0, HEAD_VERSION, COMPAT_VERSION)
{}
private:
~MMonMgrReport() override {}

View File

@ -20,11 +20,8 @@
#include "mon/mon_types.h"
#include "include/ceph_features.h"
class MMonPaxos : public Message {
class MMonPaxos : public MessageInstance<MMonPaxos> {
public:
typedef boost::intrusive_ptr<MMonPaxos> ref;
typedef boost::intrusive_ptr<MMonPaxos const> const_ref;
using factory = MessageFactory<MMonPaxos>;
friend factory;
private:
static const int HEAD_VERSION = 4;
@ -70,9 +67,9 @@ private:
bufferlist feature_map;
MMonPaxos() : Message(MSG_MON_PAXOS, HEAD_VERSION, COMPAT_VERSION) { }
MMonPaxos() : MessageInstance(MSG_MON_PAXOS, HEAD_VERSION, COMPAT_VERSION) { }
MMonPaxos(epoch_t e, int o, utime_t now) :
Message(MSG_MON_PAXOS, HEAD_VERSION, COMPAT_VERSION),
MessageInstance(MSG_MON_PAXOS, HEAD_VERSION, COMPAT_VERSION),
epoch(e),
op(o),
first_committed(0), last_committed(0), pn_from(0), pn(0), uncommitted_pn(0),

View File

@ -20,11 +20,8 @@
#include "msg/Message.h"
#include "mon/MonMap.h"
class MMonProbe : public Message {
class MMonProbe : public MessageInstance<MMonProbe> {
public:
typedef boost::intrusive_ptr<MMonProbe> ref;
typedef boost::intrusive_ptr<MMonProbe const> const_ref;
using factory = MessageFactory<MMonProbe>;
friend factory;
static const int HEAD_VERSION = 6;
@ -62,9 +59,9 @@ public:
uint64_t required_features = 0;
MMonProbe()
: Message(MSG_MON_PROBE, HEAD_VERSION, COMPAT_VERSION) {}
: MessageInstance(MSG_MON_PROBE, HEAD_VERSION, COMPAT_VERSION) {}
MMonProbe(const uuid_d& f, int o, const string& n, bool hej)
: Message(MSG_MON_PROBE, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_PROBE, HEAD_VERSION, COMPAT_VERSION),
fsid(f),
op(o),
name(n),

View File

@ -16,23 +16,15 @@
#include "msg/Message.h"
class MMonQuorumService : public Message {
class MMonQuorumService : public MessageSubType<MMonQuorumService> {
public:
typedef boost::intrusive_ptr<MMonQuorumService> ref;
typedef boost::intrusive_ptr<MMonQuorumService const> const_ref;
using factory = MessageFactory<MMonQuorumService>;
friend factory;
epoch_t epoch;
version_t round;
MMonQuorumService(int type, int head=1, int compat=1) :
Message(type, head, compat),
epoch(0),
round(0)
{ }
epoch_t epoch = 0;
version_t round = 0;
protected:
template<typename... Args>
MMonQuorumService(Args&&... args) : MessageSubType(std::forward<Args>(args)...) {}
~MMonQuorumService() override { }
public:

View File

@ -16,11 +16,8 @@
#include "msg/Message.h"
#include "mon/mon_types.h"
class MMonScrub : public Message {
class MMonScrub : public MessageInstance<MMonScrub> {
public:
typedef boost::intrusive_ptr<MMonScrub> ref;
typedef boost::intrusive_ptr<MMonScrub const> const_ref;
using factory = MessageFactory<MMonScrub>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -47,12 +44,12 @@ public:
pair<string,string> key;
MMonScrub()
: Message(MSG_MON_SCRUB, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_SCRUB, HEAD_VERSION, COMPAT_VERSION),
num_keys(-1)
{ }
MMonScrub(op_type_t op, version_t v, int32_t num_keys)
: Message(MSG_MON_SCRUB, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_SCRUB, HEAD_VERSION, COMPAT_VERSION),
op(op), version(v), num_keys(num_keys)
{ }

View File

@ -29,11 +29,8 @@ struct ceph_mon_subscribe_item_old {
WRITE_RAW_ENCODER(ceph_mon_subscribe_item_old)
class MMonSubscribe : public Message {
class MMonSubscribe : public MessageInstance<MMonSubscribe> {
public:
typedef boost::intrusive_ptr<MMonSubscribe> ref;
typedef boost::intrusive_ptr<MMonSubscribe const> const_ref;
using factory = MessageFactory<MMonSubscribe>;
friend factory;
static const int HEAD_VERSION = 3;
@ -42,7 +39,7 @@ public:
string hostname;
map<string, ceph_mon_subscribe_item> what;
MMonSubscribe() : Message(CEPH_MSG_MON_SUBSCRIBE, HEAD_VERSION, COMPAT_VERSION) { }
MMonSubscribe() : MessageInstance(CEPH_MSG_MON_SUBSCRIBE, HEAD_VERSION, COMPAT_VERSION) { }
private:
~MMonSubscribe() override {}

View File

@ -17,20 +17,17 @@
#include "msg/Message.h"
class MMonSubscribeAck : public Message {
class MMonSubscribeAck : public MessageInstance<MMonSubscribeAck> {
public:
typedef boost::intrusive_ptr<MMonSubscribeAck> ref;
typedef boost::intrusive_ptr<MMonSubscribeAck const> const_ref;
using factory = MessageFactory<MMonSubscribeAck>;
friend factory;
__u32 interval;
uuid_d fsid;
MMonSubscribeAck() : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
MMonSubscribeAck() : MessageInstance(CEPH_MSG_MON_SUBSCRIBE_ACK),
interval(0) {
}
MMonSubscribeAck(uuid_d& f, int i) : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
MMonSubscribeAck(uuid_d& f, int i) : MessageInstance(CEPH_MSG_MON_SUBSCRIBE_ACK),
interval(i), fsid(f) { }
private:
~MMonSubscribeAck() override {}

View File

@ -15,11 +15,8 @@
#include "msg/Message.h"
class MMonSync : public Message {
class MMonSync : public MessageInstance<MMonSync> {
public:
typedef boost::intrusive_ptr<MMonSync> ref;
typedef boost::intrusive_ptr<MMonSync const> const_ref;
using factory = MessageFactory<MMonSync>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -66,11 +63,11 @@ public:
entity_inst_t reply_to;
MMonSync()
: Message(MSG_MON_SYNC, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_MON_SYNC, HEAD_VERSION, COMPAT_VERSION)
{ }
MMonSync(uint32_t op, uint64_t c = 0)
: Message(MSG_MON_SYNC, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_MON_SYNC, HEAD_VERSION, COMPAT_VERSION),
op(op),
cookie(c),
last_committed(0)

View File

@ -22,11 +22,8 @@
/*
* A message with no (remote) effect.
*/
class MNop : public Message {
class MNop : public MessageInstance<MNop> {
public:
typedef boost::intrusive_ptr<MNop> ref;
typedef boost::intrusive_ptr<MNop const> const_ref;
using factory = MessageFactory<MNop>;
friend factory;
static const int HEAD_VERSION = 1;
@ -35,7 +32,7 @@ public:
__u32 tag; // ignored tag value
MNop()
: Message(MSG_NOP, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_NOP, HEAD_VERSION, COMPAT_VERSION)
{}
~MNop() {}

View File

@ -19,17 +19,14 @@
#include "messages/PaxosServiceMessage.h"
class MOSDAlive : public PaxosServiceMessage {
class MOSDAlive : public MessageInstance<MOSDAlive, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MOSDAlive> ref;
typedef boost::intrusive_ptr<MOSDAlive const> const_ref;
using factory = MessageFactory<MOSDAlive>;
friend factory;
epoch_t want = 0;
MOSDAlive(epoch_t h, epoch_t w) : PaxosServiceMessage(MSG_OSD_ALIVE, h), want(w) { }
MOSDAlive() : PaxosServiceMessage(MSG_OSD_ALIVE, 0) {}
MOSDAlive(epoch_t h, epoch_t w) : MessageInstance(MSG_OSD_ALIVE, h), want(w) { }
MOSDAlive() : MessageInstance(MSG_OSD_ALIVE, 0) {}
private:
~MOSDAlive() override {}

View File

@ -19,11 +19,8 @@
#include "MOSDFastDispatchOp.h"
#include "osd/osd_types.h"
class MOSDBackoff : public MOSDFastDispatchOp {
class MOSDBackoff : public MessageInstance<MOSDBackoff, MOSDFastDispatchOp> {
public:
typedef boost::intrusive_ptr<MOSDBackoff> ref;
typedef boost::intrusive_ptr<MOSDBackoff const> const_ref;
using factory = MessageFactory<MOSDBackoff>;
friend factory;
static constexpr int HEAD_VERSION = 1;
@ -43,10 +40,10 @@ public:
}
MOSDBackoff()
: MOSDFastDispatchOp(CEPH_MSG_OSD_BACKOFF, HEAD_VERSION, COMPAT_VERSION) {}
: MessageInstance(CEPH_MSG_OSD_BACKOFF, HEAD_VERSION, COMPAT_VERSION) {}
MOSDBackoff(spg_t pgid_, epoch_t ep, uint8_t op_, uint64_t id_,
hobject_t begin_, hobject_t end_)
: MOSDFastDispatchOp(CEPH_MSG_OSD_BACKOFF, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(CEPH_MSG_OSD_BACKOFF, HEAD_VERSION, COMPAT_VERSION),
pgid(pgid_),
map_epoch(ep),
op(op_),

View File

@ -3,21 +3,18 @@
#pragma once
class MOSDBeacon : public PaxosServiceMessage {
class MOSDBeacon : public MessageInstance<MOSDBeacon, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MOSDBeacon> ref;
typedef boost::intrusive_ptr<MOSDBeacon const> const_ref;
using factory = MessageFactory<MOSDBeacon>;
friend factory;
std::vector<pg_t> pgs;
epoch_t min_last_epoch_clean = 0;
MOSDBeacon()
: PaxosServiceMessage(MSG_OSD_BEACON, 0)
: MessageInstance(MSG_OSD_BEACON, 0)
{}
MOSDBeacon(epoch_t e, epoch_t min_lec)
: PaxosServiceMessage(MSG_OSD_BEACON, e),
: MessageInstance(MSG_OSD_BEACON, e),
min_last_epoch_clean(min_lec)
{}
void encode_payload(uint64_t features) override {

View File

@ -20,11 +20,8 @@
#include "include/types.h"
#include "osd/osd_types.h"
class MOSDBoot : public PaxosServiceMessage {
class MOSDBoot : public MessageInstance<MOSDBoot, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MOSDBoot> ref;
typedef boost::intrusive_ptr<MOSDBoot const> const_ref;
using factory = MessageFactory<MOSDBoot>;
friend factory;
private:
static const int HEAD_VERSION = 6;
@ -39,7 +36,7 @@ private:
uint64_t osd_features;
MOSDBoot()
: PaxosServiceMessage(MSG_OSD_BOOT, 0, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_BOOT, 0, HEAD_VERSION, COMPAT_VERSION),
boot_epoch(0), osd_features(0)
{ }
MOSDBoot(OSDSuperblock& s, epoch_t e, epoch_t be,
@ -47,7 +44,7 @@ private:
const entity_addrvec_t& hb_front_addr_ref,
const entity_addrvec_t& cluster_addr_ref,
uint64_t feat)
: PaxosServiceMessage(MSG_OSD_BOOT, e, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_BOOT, e, HEAD_VERSION, COMPAT_VERSION),
sb(s),
hb_back_addrs(hb_back_addr_ref),
hb_front_addrs(hb_front_addr_ref),

View File

@ -18,11 +18,8 @@
#include "MOSDFastDispatchOp.h"
#include "osd/ECMsgTypes.h"
class MOSDECSubOpRead : public MOSDFastDispatchOp {
class MOSDECSubOpRead : public MessageInstance<MOSDECSubOpRead, MOSDFastDispatchOp> {
public:
typedef boost::intrusive_ptr<MOSDECSubOpRead> ref;
typedef boost::intrusive_ptr<MOSDECSubOpRead const> const_ref;
using factory = MessageFactory<MOSDECSubOpRead>;
friend factory;
private:
static const int HEAD_VERSION = 3;
@ -47,7 +44,7 @@ public:
}
MOSDECSubOpRead()
: MOSDFastDispatchOp(MSG_OSD_EC_READ, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_OSD_EC_READ, HEAD_VERSION, COMPAT_VERSION)
{}
void decode_payload() override {

View File

@ -18,11 +18,8 @@
#include "MOSDFastDispatchOp.h"
#include "osd/ECMsgTypes.h"
class MOSDECSubOpReadReply : public MOSDFastDispatchOp {
class MOSDECSubOpReadReply : public MessageInstance<MOSDECSubOpReadReply, MOSDFastDispatchOp> {
public:
typedef boost::intrusive_ptr<MOSDECSubOpReadReply> ref;
typedef boost::intrusive_ptr<MOSDECSubOpReadReply const> const_ref;
using factory = MessageFactory<MOSDECSubOpReadReply>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -47,7 +44,7 @@ public:
}
MOSDECSubOpReadReply()
: MOSDFastDispatchOp(MSG_OSD_EC_READ_REPLY, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_OSD_EC_READ_REPLY, HEAD_VERSION, COMPAT_VERSION)
{}
void decode_payload() override {

View File

@ -18,11 +18,8 @@
#include "MOSDFastDispatchOp.h"
#include "osd/ECMsgTypes.h"
class MOSDECSubOpWrite : public MOSDFastDispatchOp {
class MOSDECSubOpWrite : public MessageInstance<MOSDECSubOpWrite, MOSDFastDispatchOp> {
public:
typedef boost::intrusive_ptr<MOSDECSubOpWrite> ref;
typedef boost::intrusive_ptr<MOSDECSubOpWrite const> const_ref;
using factory = MessageFactory<MOSDECSubOpWrite>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -47,10 +44,10 @@ public:
}
MOSDECSubOpWrite()
: MOSDFastDispatchOp(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION)
{}
MOSDECSubOpWrite(ECSubWrite &in_op)
: MOSDFastDispatchOp(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION) {
: MessageInstance(MSG_OSD_EC_WRITE, HEAD_VERSION, COMPAT_VERSION) {
op.claim(in_op);
}

View File

@ -18,11 +18,8 @@
#include "MOSDFastDispatchOp.h"
#include "osd/ECMsgTypes.h"
class MOSDECSubOpWriteReply : public MOSDFastDispatchOp {
class MOSDECSubOpWriteReply : public MessageInstance<MOSDECSubOpWriteReply, MOSDFastDispatchOp> {
public:
typedef boost::intrusive_ptr<MOSDECSubOpWriteReply> ref;
typedef boost::intrusive_ptr<MOSDECSubOpWriteReply const> const_ref;
using factory = MessageFactory<MOSDECSubOpWriteReply>;
friend factory;
private:
static const int HEAD_VERSION = 2;
@ -47,7 +44,7 @@ public:
}
MOSDECSubOpWriteReply()
: MOSDFastDispatchOp(MSG_OSD_EC_WRITE_REPLY, HEAD_VERSION, COMPAT_VERSION)
: MessageInstance(MSG_OSD_EC_WRITE_REPLY, HEAD_VERSION, COMPAT_VERSION)
{}
void decode_payload() override {

View File

@ -19,11 +19,8 @@
#include "messages/PaxosServiceMessage.h"
class MOSDFailure : public PaxosServiceMessage {
class MOSDFailure : public MessageInstance<MOSDFailure, PaxosServiceMessage> {
public:
typedef boost::intrusive_ptr<MOSDFailure> ref;
typedef boost::intrusive_ptr<MOSDFailure const> const_ref;
using factory = MessageFactory<MOSDFailure>;
friend factory;
private:
static const int HEAD_VERSION = 4;
@ -43,10 +40,10 @@ private:
epoch_t epoch = 0;
int32_t failed_for = 0; // known to be failed since at least this long
MOSDFailure() : PaxosServiceMessage(MSG_OSD_FAILURE, 0, HEAD_VERSION) { }
MOSDFailure() : MessageInstance(MSG_OSD_FAILURE, 0, HEAD_VERSION) { }
MOSDFailure(const uuid_d &fs, int osd, const entity_addrvec_t& av,
int duration, epoch_t e)
: PaxosServiceMessage(MSG_OSD_FAILURE, e, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_FAILURE, e, HEAD_VERSION, COMPAT_VERSION),
fsid(fs),
target_osd(osd),
target_addrs(av),
@ -55,7 +52,7 @@ private:
MOSDFailure(const uuid_d &fs, int osd, const entity_addrvec_t& av,
int duration,
epoch_t e, __u8 extra_flags)
: PaxosServiceMessage(MSG_OSD_FAILURE, e, HEAD_VERSION, COMPAT_VERSION),
: MessageInstance(MSG_OSD_FAILURE, e, HEAD_VERSION, COMPAT_VERSION),
fsid(fs),
target_osd(osd),
target_addrs(av),

Some files were not shown because too many files have changed in this diff Show More