]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/SessionMap.h: add const to member functions 9677/head
authorMichal Jarzabek <stiopa@gmail.com>
Sun, 12 Jun 2016 19:48:07 +0000 (20:48 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Sun, 19 Jun 2016 13:25:36 +0000 (14:25 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/mds/SessionMap.h

index 5221447e0bc64ab8d9abbd3f7ac2c2d956337de8..c1f5175f631f380b33e9efe96033bb23b95a1a8f 100644 (file)
@@ -466,20 +466,20 @@ public:
 
   // sessions
   void decode_legacy(bufferlist::iterator& blp);
-  bool empty() { return session_map.empty(); }
+  bool empty() const { return session_map.empty(); }
   const ceph::unordered_map<entity_name_t, Session*> &get_sessions() const
   {
     return session_map;
   }
 
-  bool is_any_state(int state) {
-    map<int,xlist<Session*>* >::iterator p = by_state.find(state);
+  bool is_any_state(int state) const {
+    map<int,xlist<Session*>* >::const_iterator p = by_state.find(state);
     if (p == by_state.end() || p->second->empty())
       return false;
     return true;
   }
 
-  bool have_unclosed_sessions() {
+  bool have_unclosed_sessions() const {
     return
       is_any_state(Session::STATE_OPENING) ||
       is_any_state(Session::STATE_OPEN) ||
@@ -487,7 +487,7 @@ public:
       is_any_state(Session::STATE_STALE) ||
       is_any_state(Session::STATE_KILLING);
   }
-  bool have_session(entity_name_t w) {
+  bool have_session(entity_name_t w) const {
     return session_map.count(w);
   }
   Session* get_session(entity_name_t w) {