Merge pull request #14619 from cbodley/wip-rgw-encryption-build-fix

rgw: remove extra RGWMPObj in rgw_multi.h

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-04-18 13:17:52 -05:00 committed by GitHub
commit 0e0fc8c205

View File

@ -79,70 +79,6 @@ public:
}
};
class RGWMPObj {
string oid;
string prefix;
string meta;
string upload_id;
public:
RGWMPObj() {}
RGWMPObj(const string& _oid, const string& _upload_id) {
init(_oid, _upload_id, _upload_id);
}
void init(const string& _oid, const string& _upload_id) {
init(_oid, _upload_id, _upload_id);
}
void init(const string& _oid, const string& _upload_id, const string& part_unique_str) {
if (_oid.empty()) {
clear();
return;
}
oid = _oid;
upload_id = _upload_id;
prefix = oid + ".";
meta = prefix + upload_id + MP_META_SUFFIX;
prefix.append(part_unique_str);
}
string& get_meta() { return meta; }
string get_part(int num) {
char buf[16];
snprintf(buf, 16, ".%d", num);
string s = prefix;
s.append(buf);
return s;
}
string get_part(string& part) {
string s = prefix;
s.append(".");
s.append(part);
return s;
}
string& get_upload_id() {
return upload_id;
}
string& get_key() {
return oid;
}
bool from_meta(string& meta) {
int end_pos = meta.rfind('.'); // search for ".meta"
if (end_pos < 0)
return false;
int mid_pos = meta.rfind('.', end_pos - 1); // <key>.<upload_id>
if (mid_pos < 0)
return false;
oid = meta.substr(0, mid_pos);
upload_id = meta.substr(mid_pos + 1, end_pos - mid_pos - 1);
init(oid, upload_id, upload_id);
return true;
}
void clear() {
oid = "";
prefix = "";
meta = "";
upload_id = "";
}
};
extern bool is_v2_upload_id(const string& upload_id);
extern int list_multipart_parts(RGWRados *store, RGWBucketInfo& bucket_info, CephContext *cct,