]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: new encoding for pg_history_t
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 20:41:41 +0000 (12:41 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 10 Feb 2012 05:58:07 +0000 (21:58 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/osd_types.cc

index 2222cc8387ae2bcfd5a37364a5baa19588c7aa3c..617212de55d16185610e7ea8f242695d44111147 100644 (file)
@@ -1059,8 +1059,7 @@ void pool_stat_t::generate_test_instances(list<pool_stat_t*>& o)
 
 void pg_history_t::encode(bufferlist &bl) const
 {
-  __u8 struct_v = 3;
-  ::encode(struct_v, bl);
+  ENCODE_START(4, 4, bl);
   ::encode(epoch_created, bl);
   ::encode(last_epoch_started, bl);
   ::encode(last_epoch_clean, bl);
@@ -1070,12 +1069,12 @@ void pg_history_t::encode(bufferlist &bl) const
   ::encode(same_primary_since, bl);
   ::encode(last_scrub, bl);
   ::encode(last_scrub_stamp, bl);
+  ENCODE_FINISH(bl);
 }
 
 void pg_history_t::decode(bufferlist::iterator &bl)
 {
-  __u8 struct_v;
-  ::decode(struct_v, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, bl);
   ::decode(epoch_created, bl);
   ::decode(last_epoch_started, bl);
   if (struct_v >= 3)
@@ -1090,6 +1089,7 @@ void pg_history_t::decode(bufferlist::iterator &bl)
     ::decode(last_scrub, bl);
     ::decode(last_scrub_stamp, bl);
   }
+  DECODE_FINISH(bl);
 }
 
 void pg_history_t::dump(Formatter *f) const