cerr << "ERROR: object not specified" << std::endl;
return EINVAL;
}
- int ret = init_bucket(bucket_name, bucket);
+
+ RGWBucketInfo bucket_info;
+ int ret = init_bucket(bucket_name, bucket_info, bucket);
if (ret < 0) {
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
rgw_obj obj(bucket, object);
- ret = store->rewrite_obj(obj);
+ ret = store->rewrite_obj(bucket_info.owner, obj);
if (ret < 0) {
cerr << "ERROR: object rewrite returned: " << cpp_strerror(-ret) << std::endl;
return EINVAL;
}
- int ret = init_bucket(bucket_name, bucket);
+ RGWBucketInfo bucket_info;
+ int ret = init_bucket(bucket_name, bucket_info, bucket);
if (ret < 0) {
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
formatter->dump_string("status", "Skipped");
} else {
rgw_obj obj(bucket, name);
- r = store->rewrite_obj(obj);
+ r = store->rewrite_obj(bucket_info.owner, obj);
if (r == 0) {
formatter->dump_string("status", "Success");
} else {
}
};
-int RGWRados::rewrite_obj(rgw_obj& obj)
+int RGWRados::rewrite_obj(const string& bucket_owner, rgw_obj& obj)
{
map<string, bufferlist> attrset;
off_t ofs = 0;
attrset.erase(RGW_ATTR_ID_TAG);
- return copy_obj_data((void *)&rctx, &handle, end, obj, obj, &mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL);
+ return copy_obj_data((void *)&rctx, bucket_owner, &handle, end, obj, obj, &mtime, attrset, RGW_OBJ_CATEGORY_MAIN, NULL, NULL);
}
/**
return clone_objs(ctx, dst_obj, v, attrs, category, pmtime, truncate_dest, exclusive, xattr_cond);
}
- int rewrite_obj(rgw_obj& obj);
+ int rewrite_obj(const string& bucket_owner, rgw_obj& obj);
/**
* Copy an object.
* dest_obj: the object to copy into