bool is_olh = state->is_olh;
bool reset_obj = (meta.flags & PUT_OBJ_CREATE) != 0;
- r = target->prepare_atomic_modification(op, reset_obj, meta.ptag, meta.if_match, meta.if_nomatch);
+ r = target->prepare_atomic_modification(op, reset_obj, meta.ptag, meta.if_match, meta.if_nomatch, false);
if (r < 0)
return r;
ObjectWriteOperation op;
- r = target->prepare_atomic_modification(op, false, NULL, NULL, NULL);
+ r = target->prepare_atomic_modification(op, false, NULL, NULL, NULL, true);
if (r < 0)
return r;
}
int RGWRados::Object::prepare_atomic_modification(ObjectWriteOperation& op, bool reset_obj, const string *ptag,
- const char *if_match, const char *if_nomatch)
+ const char *if_match, const char *if_nomatch, bool removal_op)
{
int r = get_state(&state, false);
if (r < 0)
}
}
+ if (removal_op) {
+ /* the object is being removed, no need to update its tag */
+ return 0;
+ }
+
if (ptag) {
state->write_tag = *ptag;
} else {
void invalidate_state();
int prepare_atomic_modification(librados::ObjectWriteOperation& op, bool reset_obj, const string *ptag,
- const char *ifmatch, const char *ifnomatch);
+ const char *ifmatch, const char *ifnomatch, bool removal_op);
int complete_atomic_modification();
public: