]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: NULL is not a bool
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 7 Nov 2016 21:31:59 +0000 (16:31 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 17 Nov 2016 00:54:31 +0000 (19:54 -0500)
Really you shouldn't use NULL at all, this is a demonstration of why.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_rados.cc

index 39f1107d011ba24f5c92058398faf21effbb3b3b..8848ab8db2c46817269cb1b0ca5011e1d1940c01 100644 (file)
@@ -650,7 +650,7 @@ int rgw_remove_bucket_bypass_gc(RGWRados *store, rgw_bucket& bucket,
       rgw_obj obj(bucket, (*it).key.name);
       obj.set_instance((*it).key.instance);
 
-      ret = store->get_obj_state(&obj_ctx, obj, &astate, NULL);
+      ret = store->get_obj_state(&obj_ctx, obj, &astate, false);
       if (ret == -ENOENT) {
         dout(1) << "WARNING: cannot find obj state for obj " << obj.get_object() << dendl;
         continue;
index 352c87e7b7fc2cde36feb508b4fad6e044203985..63af521f5cf78f15aa8b53efa90ca31e51385645 100644 (file)
@@ -5903,7 +5903,7 @@ int RGWRados::fix_tail_obj_locator(rgw_bucket& bucket, rgw_obj_key& key, bool fi
 
   RGWObjState *astate = NULL;
   RGWObjectCtx rctx(this);
-  r = get_obj_state(&rctx, obj, &astate, NULL);
+  r = get_obj_state(&rctx, obj, &astate, false);
   if (r < 0)
     return r;
 
@@ -7092,7 +7092,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
 
   if (copy_if_newer) {
     /* need to get mtime for destination */
-    ret = get_obj_state(&obj_ctx, dest_obj, &dest_state, NULL);
+    ret = get_obj_state(&obj_ctx, dest_obj, &dest_state, false);
     if (ret < 0)
       goto set_err_state;
 
@@ -7194,7 +7194,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
     if (copy_if_newer && cb.is_canceled()) {
       ldout(cct, 20) << "raced with another write of obj: " << dest_obj << dendl;
       obj_ctx.invalidate(dest_obj); /* object was overwritten */
-      ret = get_obj_state(&obj_ctx, dest_obj, &dest_state, NULL);
+      ret = get_obj_state(&obj_ctx, dest_obj, &dest_state, false);
       if (ret < 0) {
         ldout(cct, 0) << "ERROR: " << __func__ << ": get_err_state() returned ret=" << ret << dendl;
         goto set_err_state;
@@ -8031,7 +8031,7 @@ int RGWRados::defer_gc(void *ctx, rgw_obj& obj)
 
   RGWObjState *state = NULL;
 
-  int r = get_obj_state(rctx, obj, &state, NULL);
+  int r = get_obj_state(rctx, obj, &state, false);
   if (r < 0)
     return r;
 
@@ -8723,7 +8723,7 @@ int RGWRados::append_atomic_test(RGWObjectCtx *rctx, rgw_obj& obj,
   if (!rctx)
     return 0;
 
-  int r = get_obj_state(rctx, obj, pstate, NULL);
+  int r = get_obj_state(rctx, obj, pstate, false);
   if (r < 0)
     return r;
 
@@ -9928,7 +9928,7 @@ int RGWRados::iterate_obj(RGWObjectCtx& obj_ctx, rgw_obj& obj,
   bool reading_from_head = true;
   RGWObjState *astate = NULL;
 
-  int r = get_obj_state(&obj_ctx, obj, &astate, NULL);
+  int r = get_obj_state(&obj_ctx, obj, &astate, false);
   if (r < 0) {
     return r;
   }
@@ -12073,7 +12073,7 @@ int RGWRados::check_disk_state(librados::IoCtx io_ctx,
 
   RGWObjState *astate = NULL;
   RGWObjectCtx rctx(this);
-  int r = get_obj_state(&rctx, obj, &astate, NULL);
+  int r = get_obj_state(&rctx, obj, &astate, false);
   if (r < 0)
     return r;