]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add append_atomic_test() overload for RGWObjState
authorCasey Bodley <cbodley@redhat.com>
Wed, 21 Nov 2018 18:08:38 +0000 (13:08 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 5 Dec 2018 16:16:54 +0000 (11:16 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 080195b6597b1cc62b0bc6962952c56e321d2ad8..96397c508e766e880b1359ea75a41bcec20d2a83 100644 (file)
@@ -5833,10 +5833,14 @@ int RGWRados::append_atomic_test(RGWObjectCtx *rctx,
   if (r < 0)
     return r;
 
-  RGWObjState *state = *pstate;
+  return append_atomic_test(*pstate, op);
+}
 
+int RGWRados::append_atomic_test(const RGWObjState* state,
+                                 librados::ObjectOperation& op)
+{
   if (!state->is_atomic) {
-    ldout(cct, 20) << "state for obj=" << obj << " is not atomic, not appending atomic test" << dendl;
+    ldout(cct, 20) << "state for obj=" << state->obj << " is not atomic, not appending atomic test" << dendl;
     return 0;
   }
 
index 5a9c142cfd05a5c7a341e64319f51f536a75a410..90045a87f77bf09835cc5accbdf895eb58acce85 100644 (file)
@@ -1255,6 +1255,7 @@ class RGWRados : public AdminSocketHook
                          bool follow_olh, bool assume_noent = false);
   int append_atomic_test(RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj,
                          librados::ObjectOperation& op, RGWObjState **state);
+  int append_atomic_test(const RGWObjState* astate, librados::ObjectOperation& op);
 
   int update_placement_map();
   int store_bucket_info(RGWBucketInfo& info, map<string, bufferlist> *pattrs, RGWObjVersionTracker *objv_tracker, bool exclusive);