]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: rename failsafe [near]full getters appropriately
authorSage Weil <sage@redhat.com>
Thu, 23 Feb 2017 19:16:51 +0000 (14:16 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 Mar 2017 18:59:59 +0000 (13:59 -0500)
...and make most of these methods private to clarify the public
interface

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 1a3b4b5b176d867a28910c10d3ef2b743e9b5473..d1df4799b88a35e877deccd3a98ae93b1944c798 100644 (file)
@@ -64,6 +64,7 @@
 #include "messages/MOSDPing.h"
 #include "messages/MOSDFailure.h"
 #include "messages/MOSDMarkMeDown.h"
+#include "messages/MOSDFull.h"
 #include "messages/MOSDOp.h"
 #include "messages/MOSDOpReply.h"
 #include "messages/MOSDBackoff.h"
@@ -699,14 +700,14 @@ void OSDService::promote_throttle_recalibrate()
 
 // -------------------------------------
 
-float OSDService::get_full_ratio()
+float OSDService::get_failsafe_full_ratio()
 {
   float full_ratio = cct->_conf->osd_failsafe_full_ratio;
   if (full_ratio > 1.0) full_ratio /= 100.0;
   return full_ratio;
 }
 
-float OSDService::get_nearfull_ratio()
+float OSDService::get_failsafe_nearfull_ratio()
 {
   float nearfull_ratio = cct->_conf->osd_failsafe_nearfull_ratio;
   if (nearfull_ratio > 1.0) nearfull_ratio /= 100.0;
@@ -725,9 +726,10 @@ void OSDService::check_nearfull_warning(const osd_stat_t &osd_stat)
   // chunks reserved for metadata, and for our purposes (avoiding
   // completely filling the disk) it's far more important to know how
   // much space is available to use than how much we've already used.
-  float ratio = ((float)(osd_stat.kb - osd_stat.kb_avail)) / ((float)osd_stat.kb);
-  float nearfull_ratio = get_nearfull_ratio();
-  float full_ratio = get_full_ratio();
+  float ratio = ((float)(osd_stat.kb - osd_stat.kb_avail)) /
+    ((float)osd_stat.kb);
+  float nearfull_ratio = get_failsafe_nearfull_ratio();
+  float full_ratio = get_failsafe_full_ratio();
   cur_ratio = ratio;
 
   if (full_ratio > 0 && ratio > full_ratio) {
index 9114a5d2e9d27492e36d06f067ff852660d81803..6e16d633cbdd2d1bc4e5aa0bd09b126498cfe3f5 100644 (file)
@@ -1134,13 +1134,15 @@ public:
   }
 
   // -- OSD Full Status --
+private:
   Mutex full_status_lock;
   enum s_names { NONE, NEAR, FULL } cur_state;
   time_t last_msg;
   double cur_ratio;
-  float get_full_ratio();
-  float get_nearfull_ratio();
+  float get_failsafe_full_ratio();
+  float get_failsafe_nearfull_ratio();
   void check_nearfull_warning(const osd_stat_t &stat);
+public:
   bool check_failsafe_full();
   bool too_full_for_backfill(double *ratio, double *max_ratio);