]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: make rgw_bucket_dir_entry backward compatible
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 3 Jul 2013 18:38:43 +0000 (11:38 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 3 Jul 2013 18:38:43 +0000 (11:38 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/cls/rgw/cls_rgw_types.h

index b5270da33081ec5d897dca296c162a34912fdabc..6ec23ea4f0590d75d8da72db09dfece8910e8369 100644 (file)
@@ -209,7 +209,7 @@ struct rgw_bucket_dir_entry {
   void encode(bufferlist &bl) const {
     ENCODE_START(5, 3, bl);
     ::encode(name, bl);
-    ::encode(ver, bl);
+    ::encode(ver.epoch, bl);
     ::encode(exists, bl);
     ::encode(meta, bl);
     ::encode(pending_map, bl);
@@ -221,18 +221,18 @@ struct rgw_bucket_dir_entry {
   void decode(bufferlist::iterator &bl) {
     DECODE_START_LEGACY_COMPAT_LEN(5, 3, 3, bl);
     ::decode(name, bl);
-    if (struct_v >= 4) {
-      ::decode(ver, bl);
-    } else {
-      ver.pool = 0;
-      ::decode(ver.epoch, bl);
-    }
+    ::decode(ver.epoch, bl);
     ::decode(exists, bl);
     ::decode(meta, bl);
     ::decode(pending_map, bl);
     if (struct_v >= 2) {
       ::decode(locator, bl);
     }
+    if (struct_v >= 4) {
+      ::decode(ver, bl);
+    } else {
+      ver.pool = -1;
+    }
     if (struct_v >= 5) {
       ::decode_packed_val(index_ver, bl);
       ::decode(tag, bl);