poolop: make new encoding backward compatible

This makes cea221c64 behave when messages using the old encoding (that is,
older versions of the client talk to us).
This commit is contained in:
Sage Weil 2010-05-07 21:27:57 -07:00
parent ffc3e63fa1
commit f6c2e1c49a

View File

@ -52,6 +52,7 @@ public:
} }
void encode_payload() { void encode_payload() {
header.version = 2;
paxos_encode(); paxos_encode();
::encode(fsid, payload); ::encode(fsid, payload);
::encode(pool, payload); ::encode(pool, payload);
@ -65,10 +66,13 @@ public:
paxos_decode(p); paxos_decode(p);
::decode(fsid, p); ::decode(fsid, p);
::decode(pool, p); ::decode(pool, p);
if (header.version < 2)
::decode(name, p);
::decode(op, p); ::decode(op, p);
::decode(auid, p); ::decode(auid, p);
::decode(snapid, p); ::decode(snapid, p);
::decode(name, p); if (header.version >= 2)
::decode(name, p);
} }
}; };