]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: drop useless OSDService::update_osd_stat()
authorSage Weil <sage@redhat.com>
Tue, 3 Oct 2017 02:32:01 +0000 (21:32 -0500)
committerJosh Durgin <jdurgin@redhat.com>
Tue, 2 Jul 2019 04:32:44 +0000 (00:32 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a66f8bfe7d49f7d33ec027eeeb67870c610610db)

Conflicts:
src/osd/OSD.cc
src/osd/OSD.h

trivial resolution

src/osd/OSD.cc
src/osd/OSD.h

index 5f690cb0e1ef52a5f16a17d3ef7dcd74bf7c4ade..c776a2bb5ca33ae929ee1b26ea8bfc2a8e26da6b 100644 (file)
@@ -951,23 +951,6 @@ osd_stat_t OSDService::set_osd_stat(const struct store_statfs_t &stbuf,
   }
 }
 
-void OSDService::update_osd_stat(vector<int>& hb_peers)
-{
-  // load osd stats first
-  struct store_statfs_t stbuf;
-  int r = osd->store->statfs(&stbuf);
-  if (r < 0) {
-    derr << "statfs() failed: " << cpp_strerror(r) << dendl;
-    return;
-  }
-
-  auto new_stat = set_osd_stat(stbuf, hb_peers, osd->get_num_pgs());
-  dout(20) << "update_osd_stat " << new_stat << dendl;
-  assert(new_stat.kb);
-  float ratio = ((float)new_stat.kb_used) / ((float)new_stat.kb);
-  check_full_status(ratio);
-}
-
 bool OSDService::check_osdmap_full(const set<pg_shard_t> &missing_on)
 {
   OSDMapRef osdmap = get_osdmap();
@@ -5223,13 +5206,24 @@ void OSD::heartbeat()
 
   dout(30) << "heartbeat checking stats" << dendl;
 
-  // refresh stats?
+  // refresh peer list and osd stats
   vector<int> hb_peers;
   for (map<int,HeartbeatInfo>::iterator p = heartbeat_peers.begin();
        p != heartbeat_peers.end();
        ++p)
     hb_peers.push_back(p->first);
-  service.update_osd_stat(hb_peers);
+
+  // refresh osd stats
+  struct store_statfs_t stbuf;
+  int r = store->statfs(&stbuf);
+  assert(r == 0);
+
+  auto new_stat = service.set_osd_stat(stbuf, hb_peers, get_num_pgs());
+  dout(20) << __func__ << new_stat << dendl;
+  assert(new_stat.kb);
+
+  float ratio = ((float)new_stat.kb_used) / ((float)new_stat.kb);
+  service.check_full_status(ratio);
 
   dout(5) << "heartbeat: " << service.get_osd_stat() << dendl;
 
index f445a2b989a07fecb6f1897f9cceed674ae84782..b5c896ef347602b3403d152cbaa676b6ecba6e7b 100644 (file)
@@ -1057,7 +1057,6 @@ public:
   osd_stat_t osd_stat;
   uint32_t seq = 0;
 
-  void update_osd_stat(vector<int>& hb_peers);
   osd_stat_t set_osd_stat(const struct store_statfs_t &stbuf,
                           vector<int>& hb_peers,
                          int num_pgs);
@@ -1106,9 +1105,9 @@ private:
   mutable int64_t injectfull = 0;
   s_names injectfull_state = NONE;
   float get_failsafe_full_ratio();
-  void check_full_status(float ratio);
   bool _check_full(s_names type, ostream &ss) const;
 public:
+  void check_full_status(float ratio);
   bool check_failsafe_full(ostream &ss) const;
   bool check_full(ostream &ss) const;
   bool check_backfill_full(ostream &ss) const;