mds: modernize SimpleLock on-wire encoding

This is a wire protocol change.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Greg Farnum 2013-01-16 16:51:17 -08:00
parent 924fb18fd9
commit 78632adca1

View File

@ -544,22 +544,22 @@ public:
// encode/decode
void encode(bufferlist& bl) const {
__u8 struct_v = 1;
::encode(struct_v, bl);
ENCODE_START(2, 2, bl);
::encode(state, bl);
if (have_more())
::encode(more()->gather_set, bl);
else
::encode(empty_gather_set, bl);
ENCODE_FINISH(bl);
}
void decode(bufferlist::iterator& p) {
__u8 struct_v;
::decode(struct_v, p);
DECODE_START(2, p);
::decode(state, p);
set<int> g;
::decode(g, p);
if (!g.empty())
more()->gather_set.swap(g);
DECODE_FINISH(p);
}
void encode_state_for_replica(bufferlist& bl) const {
__s16 s = get_replica_state();