class MClientCaps : public Message {
- static const int HEAD_VERSION = 3; // added flock metadata
+ static const int HEAD_VERSION = 4; // added flock metadata, inline data
static const int COMPAT_VERSION = 1;
public:
bufferlist snapbl;
bufferlist xattrbl;
bufferlist flockbl;
+ version_t inline_version;
+ bufferlist inline_data;
int get_caps() { return head.caps; }
int get_wanted() { return head.wanted; }
}
MClientCaps()
- : Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION) { }
+ : Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION) {
+ inline_version = 0;
+ }
MClientCaps(int op,
inodeno_t ino,
inodeno_t realm,
head.dirty = dirty;
head.migrate_seq = mseq;
peer.cap_id = 0;
+ inline_version = 0;
}
MClientCaps(int op,
inodeno_t ino, inodeno_t realm,
head.cap_id = id;
head.migrate_seq = mseq;
peer.cap_id = 0;
+ inline_version = 0;
}
private:
~MClientCaps() {}
else if (head.op == CEPH_CAP_OP_EXPORT)
memcpy(&peer, &head.peer, sizeof(peer));
}
+
+ if (header.version >= 4) {
+ ::decode(inline_version, p);
+ ::decode(inline_data, p);
+ } else {
+ inline_version = CEPH_INLINE_NONE;
+ }
}
void encode_payload(uint64_t features) {
head.snap_trace_len = snapbl.length();
header.version = 2;
return;
}
+
+ if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
+ ::encode(inline_version, payload);
+ ::encode(inline_data, payload);
+ } else {
+ header.version = 3;
+ return;
+ }
}
};