From: Orit Wasserman Date: Tue, 29 Nov 2016 12:15:05 +0000 (+0100) Subject: Revert "rgw: rgw_obj encoding fixes" X-Git-Tag: v0.94.10~8^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e396b37af147770434147c5bd0377e8624254cd9;p=ceph.git Revert "rgw: rgw_obj encoding fixes" This reverts commit c1b64c8f9c23473b758300958a94a172f1d39b64. Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index b20739545dc..d05e3167adb 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -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);