From: xie xingguo Date: Mon, 3 Jul 2017 03:02:24 +0000 (+0800) Subject: osd/OSD: update check_full_status() to accept a pre-calculated ratio only X-Git-Tag: v12.1.1~119^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c64fc1b412f587a3ac20616159f0920df28b04e;p=ceph.git osd/OSD: update check_full_status() to accept a pre-calculated ratio only We don't have to pass in the osd_stat, which is not necessary. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 3c33fafdec2b..3f0249c7ab25 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -750,11 +750,10 @@ float OSDService::get_failsafe_full_ratio() return full_ratio; } -void OSDService::check_full_status(const osd_stat_t &osd_stat) +void OSDService::check_full_status(float ratio) { Mutex::Locker l(full_status_lock); - float ratio = ((float)osd_stat.kb_used) / ((float)osd_stat.kb); cur_ratio = ratio; // The OSDMap ratios take precendence. So if the failsafe is .95 and @@ -950,7 +949,8 @@ void OSDService::update_osd_stat(vector& hb_peers) dout(20) << "update_osd_stat " << osd_stat << dendl; - check_full_status(osd_stat); + float ratio = ((float)osd_stat.kb_used) / ((float)osd_stat.kb); + check_full_status(ratio); } bool OSDService::check_osdmap_full(const set &missing_on) diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 03b56735ec5a..37835a6778f1 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1089,7 +1089,7 @@ private: mutable int64_t injectfull = 0; s_names injectfull_state = NONE; float get_failsafe_full_ratio(); - void check_full_status(const osd_stat_t &stat); + void check_full_status(float ratio); bool _check_full(s_names type, ostream &ss) const; public: bool check_failsafe_full(ostream &ss) const;