]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw: rgw_obj encoding fixes"
authorOrit Wasserman <owasserm@redhat.com>
Tue, 29 Nov 2016 12:15:05 +0000 (13:15 +0100)
committerOrit Wasserman <owasserm@redhat.com>
Mon, 2 Jan 2017 10:13:06 +0000 (12:13 +0200)
This reverts commit c1b64c8f9c23473b758300958a94a172f1d39b64.
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_common.h

index b20739545dc165b2ebff1919b06ad6799621b064..d05e3167adb15011c7a54697a355f03380d567f4 100644 (file)
@@ -933,10 +933,6 @@ struct rgw_obj_key {
     set(n, i);
   }
 
-  rgw_obj_key(const cls_rgw_obj_key& k) {
-    set(k);
-  }
-
   void set(const cls_rgw_obj_key& k) {
     name = k.name;
     instance = k.instance;
@@ -1185,7 +1181,8 @@ public:
     init(b, o);
   }
   rgw_obj(rgw_bucket& b, const rgw_obj_key& k) : in_extra_data(false) {
-    from_index_key(b, k);
+    init(b, k.name);
+    set_instance(k.instance);
   }
   void init(rgw_bucket& b, const std::string& o) {
     bucket = b;
@@ -1294,29 +1291,6 @@ public:
     return string(buf) + orig_obj;
   };
 
-  void from_index_key(rgw_bucket& b, const rgw_obj_key& key) {
-    if (key.name[0] != '_') {
-      init(b, key.name);
-      set_instance(key.instance);
-      return;
-    }
-    if (key.name[1] == '_') {
-      init(b, key.name.substr(1));
-      set_instance(key.instance);
-      return;
-    }
-    ssize_t pos = key.name.find('_', 1);
-    if (pos < 0) {
-      /* shouldn't happen, just use key */
-      init(b, key.name);
-      set_instance(key.instance);
-      return;
-    }
-
-    init_ns(b, key.name.substr(pos + 1), key.name.substr(1, pos -1));
-    set_instance(key.instance);
-  }
-
   void get_index_key(rgw_obj_key *key) const {
     key->name = get_index_key_name();
     key->instance = instance;
@@ -1407,11 +1381,6 @@ public:
       return false;
     }
 
-    if (obj[1] == '_') {
-      obj = obj.substr(1);
-      return true;
-    }
-
     size_t period_pos = obj.find('.');
     if (period_pos < pos) {
       return false;
@@ -1456,11 +1425,7 @@ public:
     if (struct_v >= 4)
       ::decode(instance, bl);
     if (ns.empty() && instance.empty()) {
-      if (object[0] != '_') {
-        orig_obj = object;
-      } else {
-       orig_obj = object.substr(1);
-      }
+      orig_obj = object;
     } else {
       if (struct_v >= 5) {
         ::decode(orig_obj, bl);