if (ret < 0)
return ret;
- // now filter out the system entries
+ int prefix_size = sizeof(RGW_BUCKET_INSTANCE_MD_PREFIX) - 1;
+ // now filter in the relevant entries
list<string>::iterator iter;
for (iter = unfiltered_keys.begin(); iter != unfiltered_keys.end(); ++iter) {
string& k = *iter;
- if (k[0] != '.') {
- keys.push_back(k);
+ if (k.compare(0, prefix_size, RGW_BUCKET_INSTANCE_MD_PREFIX) == 0) {
+ keys.push_back(k.substr(prefix_size));
}
}
void RGWRados::get_bucket_meta_oid(rgw_bucket& bucket, string& oid)
{
- oid = ".bucket.meta." + bucket.bucket_id;
+ oid = RGW_BUCKET_INSTANCE_MD_PREFIX + bucket.name + ":" + bucket.bucket_id;
}
-int RGWRados::get_bucket_instance_info(void *ctx, string& name, RGWBucketInfo& info,
+int RGWRados::get_bucket_instance_info(void *ctx, string& entry, RGWBucketInfo& info,
time_t *pmtime, map<string, bufferlist> *pattrs)
{
- /* entry in the format <bucket>/<bucket_id> */
- int pos = name.find('/');
+ int pos = entry.find(':');
if (pos < 0) {
return -EINVAL;
}
- string oid = ".bucket.meta." + name.substr(pos + 1);
+ string oid = RGW_BUCKET_INSTANCE_MD_PREFIX + entry;
return get_bucket_instance_from_oid(ctx, oid, info, pmtime, pattrs);
}
#define RGW_OBJ_NS_MULTIPART "multipart"
#define RGW_OBJ_NS_SHADOW "shadow"
+#define RGW_BUCKET_INSTANCE_MD_PREFIX ".bucket.meta."
+
static inline void prepend_bucket_marker(rgw_bucket& bucket, string& orig_oid, string& oid)
{
if (bucket.marker.empty() || orig_oid.empty()) {