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