From: Kefu Chai Date: Wed, 15 Apr 2015 04:04:05 +0000 (+0800) Subject: osd: simplify OSD::scrub_load_below_threshold() a little bit X-Git-Tag: v9.0.2~136^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ab0e606dfd2847e1918be9f21f572d91befbf7b;p=ceph.git osd: simplify OSD::scrub_load_below_threshold() a little bit avoid unnecessary comparison Signed-off-by: Kefu Chai --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 311d0d364810..7662e88a1112 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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()