]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: decode old pg_stat_t
authorSage Weil <sage@newdream.net>
Thu, 25 Aug 2011 21:08:52 +0000 (14:08 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 27 Aug 2011 17:20:54 +0000 (10:20 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/osd_types.h

index befef34a1e26804987688c073b0a76602668ece6..b65ec249da9f584dc8c66c02578ae18154da807e 100644 (file)
@@ -846,7 +846,7 @@ struct pg_stat_t {
   }
 
   void encode(bufferlist &bl) const {
-    __u8 v = 5;
+    __u8 v = 6;
     ::encode(v, bl);
 
     ::encode(version, bl);
@@ -868,7 +868,7 @@ struct pg_stat_t {
   void decode(bufferlist::iterator &bl) {
     __u8 v;
     ::decode(v, bl);
-    if (v > 5)
+    if (v > 6)
       throw buffer::malformed_input("unknown pg_stat_t encoding version > 4");
 
     ::decode(version, bl);
@@ -877,7 +877,13 @@ struct pg_stat_t {
     ::decode(log_start, bl);
     ::decode(ondisk_log_start, bl);
     ::decode(created, bl);
-    ::decode(parent, bl);
+    if (v < 6) {
+      old_pg_t opgid;
+      ::decode(opgid, bl);
+      parent = opgid;
+    } else {
+      ::decode(parent, bl);
+    }
     ::decode(parent_split_bits, bl);
     ::decode(last_scrub, bl);
     ::decode(last_scrub_stamp, bl);