map<string, bool> common_prefixes;
+ string ns = "multipart";
bool is_truncated;
map<string, bool> meta_objs;
map<rgw_obj_index_key, string> all_objs;
RGWRados::Bucket::List list_op(&target);
list_op.params.list_versions = true;
+ list_op.params.ns = ns;
do {
vector<rgw_bucket_dir_entry> result;
vector<rgw_bucket_dir_entry>::iterator iter;
for (iter = result.begin(); iter != result.end(); ++iter) {
- rgw_bucket_dir_entry& ent = *iter;
-
- rgw_obj obj(bucket, ent.key);
- obj.key.ns.clear();
-
- rgw_obj_index_key key;
- obj.key.get_index_key(&key);
-
- string oid = key.name;
+ rgw_obj_index_key key = iter->key;
+ rgw_obj obj(bucket, key);
+ string oid = obj.get_oid();
int pos = oid.find_last_of('.');
if (pos < 0) {
for (auto aiter = all_objs.begin(); aiter != all_objs.end(); ++aiter) {
string& name = aiter->second;
- rgw_obj_index_key index_key(aiter->first);
-
if (meta_objs.find(name) == meta_objs.end()) {
objs_to_unlink.push_back(aiter->first);
}
return ret;
/*
- * We're unlinking the bucket but we don't want to update the entrypoint here — we're removing
+ * We're unlinking the bucket but we don't want to update the entrypoint here - we're removing
* it immediately and don't want to invalidate our cached objv_version or the bucket obj removal
* will incorrectly fail.
*/