]> git.apps.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)
committerKefu Chai <kchai@redhat.com>
Wed, 20 May 2015 10:23:21 +0000 (18:23 +0800)
avoid unnecessary comparison

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSD.cc

index 311d0d364810bf5c4cd72b6f97fab80e231336ac..7662e88a11129c35fd666f826babed211a4ceb87 100644 (file)
@@ -5892,12 +5892,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()