]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: no need to set tag on object we're removing
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 18 Dec 2014 23:15:29 +0000 (15:15 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 19 Jan 2015 23:57:58 +0000 (15:57 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index c337ad895180658f33957c7956f2ed75fc85e033..9e6b655d45d5afa5b180c9a6a65ff261457e3388 100644 (file)
@@ -2836,7 +2836,7 @@ int RGWRados::Object::Write::write_meta(uint64_t size,
   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;
 
@@ -4059,7 +4059,7 @@ int RGWRados::Object::Delete::delete_obj()
 
   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;
 
@@ -4400,7 +4400,7 @@ void RGWRados::Object::invalidate_state()
 }
 
 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)
@@ -4468,6 +4468,11 @@ int RGWRados::Object::prepare_atomic_modification(ObjectWriteOperation& op, bool
     }
   }
 
+  if (removal_op) {
+    /* the object is being removed, no need to update its tag */
+    return 0;
+  }
+
   if (ptag) {
     state->write_tag = *ptag;
   } else {
index 34995c657985dbba231d7286a61c0c475c63b7d2..3d61b0e43d56eda1199f65e39313e8f96fcb3200 100644 (file)
@@ -1400,7 +1400,7 @@ public:
     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: