]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: add is_shutdown() state helper/accessor
authorSage Weil <sage@inktank.com>
Tue, 11 Jun 2013 00:34:12 +0000 (17:34 -0700)
committerSage Weil <sage@inktank.com>
Thu, 13 Jun 2013 17:52:17 +0000 (10:52 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 7c7577e1a00ace06545659f2a467503aa46b01c7..5a3d6fbb7b43c30426da23e6e747b67fa16af22d 100644 (file)
@@ -3190,7 +3190,7 @@ bool Monitor::_ms_dispatch(Message *m)
 {
   bool ret = true;
 
-  if (state == STATE_SHUTDOWN) {
+  if (is_shutdown()) {
     m->put();
     return true;
   }
@@ -3884,7 +3884,7 @@ bool Monitor::ms_handle_reset(Connection *con)
 {
   dout(10) << "ms_handle_reset " << con << " " << con->get_peer_addr() << dendl;
 
-  if (state == STATE_SHUTDOWN)
+  if (is_shutdown())
     return false;
 
   // ignore lossless monitor sessions
@@ -4172,7 +4172,7 @@ bool Monitor::ms_get_authorizer(int service_id, AuthAuthorizer **authorizer, boo
 {
   dout(10) << "ms_get_authorizer for " << ceph_entity_type_name(service_id) << dendl;
 
-  if (state == STATE_SHUTDOWN)
+  if (is_shutdown())
     return false;
 
   // we only connect to other monitors; every else connects to us.
@@ -4236,7 +4236,7 @@ bool Monitor::ms_verify_authorizer(Connection *con, int peer_type,
           << " " << ceph_entity_type_name(peer_type)
           << " protocol " << protocol << dendl;
 
-  if (state == STATE_SHUTDOWN)
+  if (is_shutdown())
     return false;
 
   if (peer_type == CEPH_ENTITY_TYPE_MON &&
index 6db49a9989a096c14eb35cb463675161f97bde3c..e860f8ea3756d2a4065f5c8bd9fe2a71b327aa5b 100644 (file)
@@ -177,6 +177,7 @@ public:
     return sn;
   }
 
+  bool is_shutdown() const { return state == STATE_SHUTDOWN; }
   bool is_probing() const { return state == STATE_PROBING; }
   bool is_synchronizing() const { return state == STATE_SYNCHRONIZING; }
   bool is_electing() const { return state == STATE_ELECTING; }