]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: simplify OSD::scrub_load_below_threshold() a little bit
authorKefu Chai <kchai@redhat.com>
Wed, 15 Apr 2015 04:04:05 +0000 (12:04 +0800)
committerSage Weil <sage@redhat.com>
Thu, 8 Oct 2015 03:05:58 +0000 (23:05 -0400)
avoid unnecessary comparison

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 2ab0e606dfd2847e1918be9f21f572d91befbf7b)

src/osd/OSD.cc

index 7dbcfc5ae60306bb8b529d821d310795b52a2750..705b13dbd5640f3a721e41d5d88ce2efb2bffe8d 100644 (file)
@@ -5953,12 +5953,12 @@ bool OSD::scrub_should_schedule()
             << " >= max " << cct->_conf->osd_scrub_load_threshold
             << " = no, load too high" << dendl;
     return false;
+  } else {
+    dout(20) << __func__ << " loadavg " << loadavgs[0]
+            << " < max " << cct->_conf->osd_scrub_load_threshold
+            << " = yes" << dendl;
+    return true;
   }
-
-  dout(20) << "scrub_should_schedule loadavg " << loadavgs[0]
-          << " < max " << cct->_conf->osd_scrub_load_threshold
-          << " = yes" << dendl;
-  return loadavgs[0] < cct->_conf->osd_scrub_load_threshold;
 }
 
 void OSD::sched_scrub()