]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make dispatch(), _ms_dispatch() void 2301/head
authorSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 20:10:28 +0000 (13:10 -0700)
committerSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 20:10:28 +0000 (13:10 -0700)
They always return true.

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

index 1052a5a6c3a73f84d1aad2e5e1eb9d5cd9903a84..c8fa7c4ae762916489fd1dfce6c0efbbcad8c76b 100644 (file)
@@ -2895,13 +2895,11 @@ void Monitor::waitlist_or_zap_client(Message *m)
   }
 }
 
-bool Monitor::_ms_dispatch(Message *m)
+void Monitor::_ms_dispatch(Message *m)
 {
-  bool ret = true;
-
   if (is_shutdown()) {
     m->put();
-    return true;
+    return;
   }
 
   ConnectionRef connection = m->get_connection();
@@ -2941,12 +2939,12 @@ bool Monitor::_ms_dispatch(Message *m)
       dout(1) << __func__ << " dropping stray message " << *m
              << " from " << m->get_source_inst() << dendl;
       m->put();
-      return true;
+      return;
     }
 
     if (!exited_quorum.is_zero() && !src_is_mon) {
       waitlist_or_zap_client(m);
-      return true;
+      return;
     }
 
     dout(10) << "do not have session, making new one" << dendl;
@@ -2985,22 +2983,20 @@ bool Monitor::_ms_dispatch(Message *m)
 
   if (is_synchronizing() && !src_is_mon) {
     waitlist_or_zap_client(m);
-    return true;
+    return;
   }
 
-  ret = dispatch(s, m, src_is_mon);
+  dispatch(s, m, src_is_mon);
 
   if (s) {
     s->put();
   }
 
-  return ret;
+  return;
 }
 
-bool Monitor::dispatch(MonSession *s, Message *m, const bool src_is_mon)
+void Monitor::dispatch(MonSession *s, Message *m, const bool src_is_mon)
 {
-  bool ret = true;
-
   assert(m != NULL);
 
   switch (m->get_type()) {
@@ -3163,8 +3159,6 @@ bool Monitor::dispatch(MonSession *s, Message *m, const bool src_is_mon)
       m->put();
       break;
   }
-
-  return ret;
 }
 
 void Monitor::handle_ping(MPing *m)
index 5c8671c465b9adc3859d4c6faa6c6b2bd3b4eeff..55c4e218d461e2fbdbacc11fa460d4855b1fbe52 100644 (file)
@@ -750,15 +750,15 @@ public:
 
   //ms_dispatch handles a lot of logic and we want to reuse it
   //on forwarded messages, so we create a non-locking version for this class
-  bool _ms_dispatch(Message *m);
+  void _ms_dispatch(Message *m);
   bool ms_dispatch(Message *m) {
     lock.Lock();
-    bool ret = _ms_dispatch(m);
+    _ms_dispatch(m);
     lock.Unlock();
-    return ret;
+    return true;
   }
   // dissociate message handling from session and connection logic
-  bool dispatch(MonSession *s, Message *m, const bool src_is_mon);
+  void dispatch(MonSession *s, Message *m, const bool src_is_mon);
   //mon_caps is used for un-connected messages from monitors
   MonCap * mon_caps;
   bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);