]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: s/check_sub/check_osdmap_sub/
authorKefu Chai <kchai@redhat.com>
Thu, 9 Mar 2017 02:27:43 +0000 (10:27 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 30 Mar 2017 12:21:17 +0000 (20:21 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index df56bb6c08ec30a41ef42b6df0e17ba951510849..6dc1e9c9a643a841bda320a51cf48a737633e7e2 100644 (file)
@@ -4430,7 +4430,7 @@ void Monitor::handle_subscribe(MonOpRequestRef op)
          // client needs earlier osdmaps on purpose, so reset the sent epoch
          s->osd_epoch = 0;
        }
-        osdmon()->check_sub(s->sub_map["osdmap"]);
+        osdmon()->check_osdmap_sub(s->sub_map["osdmap"]);
       }
     } else if (p->first == "osd_pg_creates") {
       if ((int)s->is_capable("osd", MON_CAP_W)) {
index 028ef88338b4f0e2d36f917b7f561486c46febe2..9134a43729949b45c4bf08174ae81682482679dc 100644 (file)
@@ -325,7 +325,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
     mon->pgmon()->check_osd_map(osdmap.epoch);
   }
 
-  check_subs();
+  check_osdmap_subs();
 
   share_map_with_random_osd();
   update_logger();
@@ -2912,21 +2912,22 @@ epoch_t OSDMonitor::blacklist(const entity_addr_t& a, utime_t until)
 }
 
 
-void OSDMonitor::check_subs()
+void OSDMonitor::check_osdmap_subs()
 {
   dout(10) << __func__ << dendl;
-  string type = "osdmap";
-  if (mon->session_map.subs.count(type) == 0)
+  auto osdmap_subs = mon->session_map.subs.find("osdmap");
+  if (osdmap_subs == mon->session_map.subs.end()) {
     return;
-  xlist<Subscription*>::iterator p = mon->session_map.subs[type]->begin();
+  }
+  auto p = osdmap_subs->second->begin();
   while (!p.end()) {
-    Subscription *sub = *p;
+    auto sub = *p;
     ++p;
-    check_sub(sub);
+    check_osdmap_sub(sub);
   }
 }
 
-void OSDMonitor::check_sub(Subscription *sub)
+void OSDMonitor::check_osdmap_sub(Subscription *sub)
 {
   dout(10) << __func__ << " " << sub << " next " << sub->next
           << (sub->onetime ? " (onetime)":" (ongoing)") << dendl;
index 70dd67735a64b27e26e6139bda8e3a1a7d3591c8..bcd15add81cbee7799be7719cabc0f369a04f400 100644 (file)
@@ -191,7 +191,7 @@ private:
    */
   bool validate_crush_against_features(const CrushWrapper *newcrush,
                                       stringstream &ss);
-
+  void check_osdmap_subs();
   void share_map_with_random_osd();
 
   Mutex prime_pg_temp_lock = {"OSDMonitor::prime_pg_temp_lock"};
@@ -449,8 +449,7 @@ private:
   int dump_osd_metadata(int osd, Formatter *f, ostream *err);
   void print_nodes(Formatter *f);
 
-  void check_subs();
-  void check_sub(Subscription *sub);
+  void check_osdmap_sub(Subscription *sub);
 
   void add_flag(int flag) {
     if (!(osdmap.flags & flag)) {