}
void encode(bufferlist& bl) const {
- __u8 struct_v = 3;
- ::encode(struct_v, bl);
assert(_enc.length());
+ ENCODE_START(4, 4, bl);
bl.append(_enc);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, bl);
::decode(dn, bl);
::decode(dnfirst, bl);
::decode(dnlast, bl);
::decode(old_inodes, bl);
}
}
+ DECODE_FINISH(bl);
}
void update_inode(MDS *mds, CInode *in);
remotebit() {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
assert(_enc.length());
+ ENCODE_START(2, 2, bl);
bl.append(_enc);
- /*
- ::encode(dn, bl);
- ::encode(dnfirst, bl);
- ::encode(dnlast, bl);
- ::encode(dnv, bl);
- ::encode(ino, bl);
- ::encode(d_type, bl);
- ::encode(dirty, bl);
- */
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(dn, bl);
::decode(dnfirst, bl);
::decode(dnlast, bl);
::decode(ino, bl);
::decode(d_type, bl);
::decode(dirty, bl);
+ DECODE_FINISH(bl);
}
void print(ostream& out) {
out << " remotebit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
nullbit() {}
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
assert(_enc.length());
+ ENCODE_START(2, 2, bl);
bl.append(_enc);
- /*
- ::encode(dn, bl);
- ::encode(dnfirst, bl);
- ::encode(dnlast, bl);
- ::encode(dnv, bl);
- ::encode(dirty, bl);
- */
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl);
::decode(dn, bl);
::decode(dnfirst, bl);
::decode(dnlast, bl);
::decode(dnv, bl);
::decode(dirty, bl);
+ DECODE_FINISH(bl);
}
void print(ostream& out) {
out << " nullbit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
p->print(out);
}
+ // if this changes, update the versioning in encode for it!
void _encode_bits() const {
::encode(dfull, dnbl);
::encode(dremote, dnbl);
}
void encode(bufferlist& bl) const {
- __u8 struct_v = 1;
- ::encode(struct_v, bl);
+ ENCODE_START(2, 2, bl);
::encode(fnode, bl);
::encode(state, bl);
::encode(nfull, bl);
::encode(nnull, bl);
_encode_bits();
::encode(dnbl, bl);
+ ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(2, 2, 2, bl)
::decode(fnode, bl);
::decode(state, bl);
::decode(nfull, bl);
::decode(nnull, bl);
::decode(dnbl, bl);
dn_decoded = false; // don't decode bits unless we need them.
+ DECODE_FINISH(bl);
}
};
WRITE_CLASS_ENCODER(dirlump)
public:
void encode(bufferlist& bl) const {
- __u8 struct_v = 4;
- ::encode(struct_v, bl);
+ ENCODE_START(5, 5, bl);
::encode(lump_order, bl);
::encode(lump_map, bl);
::encode(roots, bl);
::encode(client_reqs, bl);
::encode(renamed_dirino, bl);
::encode(renamed_dir_frags, bl);
- }
+ ENCODE_FINISH(bl);
+ }
void decode(bufferlist::iterator &bl) {
- __u8 struct_v;
- ::decode(struct_v, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, bl);
::decode(lump_order, bl);
::decode(lump_map, bl);
if (struct_v >= 4) {
::decode(renamed_dirino, bl);
::decode(renamed_dir_frags, bl);
}
+ DECODE_FINISH(bl);
}