]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Removed redundant encoding of layout.* and adjusted the corresponding decoding
authorShilpa Jagannath <smanjara@redhat.com>
Tue, 31 Mar 2020 11:18:19 +0000 (16:48 +0530)
committerShilpa Jagannath <smanjara@redhat.com>
Tue, 31 Mar 2020 11:18:19 +0000 (16:48 +0530)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/rgw_common.cc

index 0545122d12393de282a89c140fd603ded14e82f0..f929ec9d51a25b7b0028b6aa736d3cae88819950 100644 (file)
@@ -2000,15 +2000,12 @@ void RGWBucketInfo::encode(bufferlist& bl) const {
   encode(placement_rule, bl);
   encode(has_instance_obj, bl);
   encode(quota, bl);
-  encode(layout.current_index.layout.normal.num_shards, bl);
-  encode(layout.current_index.layout.normal.hash_type, bl);
   encode(requester_pays, bl);
   encode(owner.tenant, bl);
   encode(has_website, bl);
   if (has_website) {
     encode(website_conf, bl);
   }
-  encode((uint32_t)layout.current_index.layout.type, bl);
   encode(swift_versioning, bl);
   if (swift_versioning) {
     encode(swift_ver_location, bl);
@@ -2053,9 +2050,10 @@ void RGWBucketInfo::decode(bufferlist::const_iterator& bl) {
     decode(has_instance_obj, bl);
   if (struct_v >= 9)
     decode(quota, bl);
-  if (struct_v >= 10)
+  static constexpr uint8_t new_layout_v = 22;
+  if (struct_v >= 10 && struct_v < new_layout_v)
     decode(layout.current_index.layout.normal.num_shards, bl);
-  if (struct_v >= 11)
+  if (struct_v >= 11 && struct_v < new_layout_v)
     decode(layout.current_index.layout.normal.hash_type, bl);
   if (struct_v >= 12)
     decode(requester_pays, bl);
@@ -2069,7 +2067,7 @@ void RGWBucketInfo::decode(bufferlist::const_iterator& bl) {
       website_conf = RGWBucketWebsiteConf();
     }
   }
-  if (struct_v >= 15) {
+  if (struct_v >= 15 && struct_v < new_layout_v) {
     uint32_t it;
     decode(it, bl);
     layout.current_index.layout.type = (rgw::BucketIndexType)it;