]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add id to RGWZone
authorOrit Wasserman <owasserm@redhat.com>
Thu, 3 Sep 2015 08:49:44 +0000 (10:49 +0200)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:12:38 +0000 (16:12 -0800)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_json_enc.cc
src/rgw/rgw_rados.h

index 6f703a5a5708924f791dd9affa8cee4e030311ff..4ab68b2315987b58484d57d03385771db677f072 100644 (file)
@@ -868,7 +868,7 @@ static void decode_zones(map<string, RGWZone>& zones, JSONObj *o)
 {
   RGWZone z;
   z.decode_json(o);
-  zones[z.name] = z;
+  zones[z.id] = z;
 }
 
 static void decode_placement_targets(map<string, RGWZoneGroupPlacementTarget>& targets, JSONObj *o)
index d7c46cf362819e49f18281d9b50a82a271f34a6d..05f01e9c171a9a9e143849ba60d942f6ca384a97 100644 (file)
@@ -908,6 +908,7 @@ struct RGWZoneParams {
 WRITE_CLASS_ENCODER(RGWZoneParams)
 
 struct RGWZone {
+  string id;
   string name;
   list<string> endpoints;
   bool log_meta;
@@ -925,7 +926,8 @@ struct RGWZone {
   RGWZone() : log_meta(false), log_data(false), bucket_index_max_shards(0) {}
 
   void encode(bufferlist& bl) const {
-    ENCODE_START(3, 1, bl);
+    ENCODE_START(4, 1, bl);
+    ::encode(id, bl);
     ::encode(name, bl);
     ::encode(endpoints, bl);
     ::encode(log_meta, bl);
@@ -935,8 +937,14 @@ struct RGWZone {
   }
 
   void decode(bufferlist::iterator& bl) {
-    DECODE_START(2, bl);
+    DECODE_START(3, bl);
+    if (struct_v >= 4) {
+      ::decode(id, bl);
+    }
     ::decode(name, bl);
+    if (struct_v < 4) {
+      id = name;
+    }
     ::decode(endpoints, bl);
     if (struct_v >= 2) {
       ::decode(log_meta, bl);