diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-02-10 06:54:34 +0100 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-02-10 07:05:57 +0100 |
commit | 7d85c4812937140e52efb1988cff34ad879f0cc3 (patch) | |
tree | 87b0936bc1a2dd4dd9c567d444865bbad11a1dc6 /src/messages/MOSDPGCreate.h | |
parent | osd: new encoding for osd_stat_t (diff) | |
download | ceph-7d85c4812937140e52efb1988cff34ad879f0cc3.tar.xz ceph-7d85c4812937140e52efb1988cff34ad879f0cc3.zip |
osd: new encoding for pg_create_t
There was no version encoding previously, so this is an incompatible
change. Fortunately this type is only used in one place, MOSDPGCreate,
so we'll rev that encoding and compensate there. All is well!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/messages/MOSDPGCreate.h')
-rw-r--r-- | src/messages/MOSDPGCreate.h | 19 |
1 files changed, 18 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 { |