int RGWRados::Object::Delete::delete_obj()
{
RGWRados *store = target->get_store();
- rgw_obj& obj = target->get_obj();
+ rgw_obj& src_obj = target->get_obj();
+ const string& instance = src_obj.get_instance();
+ rgw_obj obj = src_obj;
+
+ if (instance == "null") {
+ obj.clear_instance();
+ }
+
bool explicit_marker_version = (params.olh_epoch > 0 || !params.marker_version_id.empty());
if (params.versioning_status & BUCKET_VERSIONED || explicit_marker_version) {
- const string& instance = obj.get_instance();
if (instance.empty() || explicit_marker_version) {
rgw_obj marker = obj;
return r;
}
} else {
-
rgw_bucket_dir_entry dirent;
+
int r = store->bi_get_instance(obj, &dirent);
if (r < 0) {
return r;
return 0;
}
- if (obj.get_instance() == "null") {
- obj.clear_instance();
- }
-
rgw_rados_ref ref;
rgw_bucket bucket;
int r = store->get_obj_ref(obj, &ref, &bucket);