From 5b6b500825b414ce0f4ca060e09fac43e7e3b770 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 2 Feb 2012 11:36:43 -0800 Subject: [PATCH] osd: new encoding for pg_pool_t Signed-off-by: Sage Weil --- src/osd/osd_types.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 7ee78229c9009..7c421b0ca24ca 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -588,8 +588,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const return; } - __u8 struct_v = 4; - ::encode(struct_v, bl); + ENCODE_START(5, 5, bl); ::encode(type, bl); ::encode(size, bl); ::encode(crush_ruleset, bl); @@ -606,15 +605,12 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const ::encode(auid, bl); ::encode(flags, bl); ::encode(crash_replay_interval, bl); + ENCODE_FINISH(bl); } void pg_pool_t::decode(bufferlist::iterator& bl) { - __u8 struct_v; - ::decode(struct_v, bl); - if (struct_v > 4) - throw buffer::error(); - + DECODE_START_LEGACY_COMPAT_LEN(5, 5, 5, bl); ::decode(type, bl); ::decode(size, bl); ::decode(crush_ruleset, bl); @@ -655,7 +651,7 @@ void pg_pool_t::decode(bufferlist::iterator& bl) else crash_replay_interval = 0; } - + DECODE_FINISH(bl); calc_pg_masks(); } -- 2.39.5