From 2ab0e606dfd2847e1918be9f21f572d91befbf7b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 15 Apr 2015 12:04:05 +0800 Subject: [PATCH] osd: simplify OSD::scrub_load_below_threshold() a little bit avoid unnecessary comparison Signed-off-by: Kefu Chai --- src/osd/OSD.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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() -- 2.47.3