]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_rados: don't assign value to parameter
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 5 Mar 2015 05:47:57 +0000 (06:47 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 11 Mar 2015 13:00:08 +0000 (14:00 +0100)
Fix for cppcheck issue:
Assignment of function parameter has no effect outside the function.

Remove assignment to need_to_wait before exit.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_rados.cc

index cb2ed4bd049de7c19f404eb2ab0df97ac9c4060c..2f7c7af1b30ba46e4bef0ef518ea2e35ac1369d3 100644 (file)
@@ -975,6 +975,8 @@ int RGWPutObjProcessor_Aio::drain_pending()
 
 int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait)
 {
+  bool _wait = need_to_wait;
+
   if (handle) {
     struct put_obj_aio_info info;
     info.handle = handle;
@@ -988,7 +990,7 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait)
     if (r < 0)
       return r;
 
-    need_to_wait = false;
+    _wait = false;
   }
 
   /* resize window in case messages are draining too fast */
@@ -997,13 +999,10 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait)
   }
 
   /* now throttle. Note that need_to_wait should only affect the first IO operation */
-  if (pending.size() > max_chunks ||
-      need_to_wait) {
+  if (pending.size() > max_chunks || _wait) {
     int r = wait_pending_front();
     if (r < 0)
       return r;
-
-    need_to_wait = false;
   }
   return 0;
 }