diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/messages/MOSDPGCreate.h | 19 | ||||
-rw-r--r-- | src/osd/osd_types.cc | 4 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/messages/MOSDPGCreate.h b/src/messages/MOSDPGCreate.h index 38410b99e1d..a9b3af74e42 100644 --- a/src/messages/MOSDPGCreate.h +++ b/src/messages/MOSDPGCreate.h @@ -38,13 +38,30 @@ public: const char *get_type_name() const { return "pg_create"; } void encode_payload(uint64_t features) { + header.version = 2; ::encode(epoch, payload); ::encode(mkpg, payload); } void decode_payload() { bufferlist::iterator p = payload.begin(); ::decode(epoch, p); - ::decode(mkpg, p); + if (header.version >= 2) { + ::decode(mkpg, p); + } else { + __u32 n; + ::decode(n, p); + while (n--) { + pg_t pgid; + epoch_t created; // epoch pg created + pg_t parent; // split from parent (if != pg_t()) + __s32 split_bits; + ::decode(pgid, p); + ::decode(created, p); + ::decode(parent, p); + ::decode(split_bits, p); + mkpg[pgid] = pg_create_t(created, parent, split_bits); + } + } } void print(ostream& out) const { diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index b79d865163b..5b4a10de4b8 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -1609,16 +1609,20 @@ void pg_missing_t::got(const std::map<hobject_t, pg_missing_t::item>::iterator & void pg_create_t::encode(bufferlist &bl) const { + ENCODE_START(1, 1, bl); ::encode(created, bl); ::encode(parent, bl); ::encode(split_bits, bl); + ENCODE_FINISH(bl); } void pg_create_t::decode(bufferlist::iterator &bl) { + DECODE_START(1, bl); ::decode(created, bl); ::decode(parent, bl); ::decode(split_bits, bl); + DECODE_FINISH(bl); } void pg_create_t::dump(Formatter *f) const |