From: Shilpa Jagannath Date: Tue, 31 Mar 2020 11:18:19 +0000 (+0530) Subject: Removed redundant encoding of layout.* and adjusted the corresponding decoding X-Git-Tag: v16.1.0~2727^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=197a141d0553a8726d00d299ec060124bef431d4;p=ceph.git Removed redundant encoding of layout.* and adjusted the corresponding decoding Signed-off-by: Shilpa Jagannath --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 0545122d12393..f929ec9d51a25 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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;