]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: json encode/decode index_type, allow modification 11707/head
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 31 Oct 2016 17:47:15 +0000 (10:47 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 31 Oct 2016 17:50:07 +0000 (10:50 -0700)
Fixes: http://tracker.ceph.com/issues/17755
We didn't dump the index_type field of RGWBucketInfo, also didn't
allow modifying it via metadata api.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_json_enc.cc

index 199dc1a4041fd46477d189b58abe2241bacc739b..979326fdd3e827caa18b9adc00911cd2b8a87c6e 100644 (file)
@@ -2150,7 +2150,6 @@ public:
       bci.info.bucket.data_pool = old_bci.info.bucket.data_pool;
       bci.info.bucket.index_pool = old_bci.info.bucket.index_pool;
       bci.info.bucket.data_extra_pool = old_bci.info.bucket.data_extra_pool;
-      bci.info.index_type = old_bci.info.index_type;
     }
 
     // are we actually going to perform this put, or is it too old?
index 225adbd10a25d9fc8fa75d3609e424df81891f1e..62e702f02161c4b6bd3e3976c2bb7852da9664e7 100644 (file)
@@ -694,6 +694,7 @@ void RGWBucketInfo::dump(Formatter *f) const
   }
   encode_json("swift_versioning", swift_versioning, f);
   encode_json("swift_ver_location", swift_ver_location, f);
+  encode_json("index_type", (uint32_t)index_type, f);
 }
 
 void RGWBucketInfo::decode_json(JSONObj *obj) {
@@ -722,6 +723,9 @@ void RGWBucketInfo::decode_json(JSONObj *obj) {
   }
   JSONDecoder::decode_json("swift_versioning", swift_versioning, obj);
   JSONDecoder::decode_json("swift_ver_location", swift_ver_location, obj);
+  uint32_t it;
+  JSONDecoder::decode_json("index_type", it, obj);
+  index_type = (RGWBucketIndexType)it;
 }
 
 void rgw_obj_key::dump(Formatter *f) const