From: Michal Jarzabek Date: Sun, 12 Jun 2016 19:48:07 +0000 (+0100) Subject: mds/SessionMap.h: add const to member functions X-Git-Tag: v11.0.0~34^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f428c2b5943a22f94dce2e18b9a97bcc30019cb5;p=ceph.git mds/SessionMap.h: add const to member functions Signed-off-by: Michal Jarzabek --- diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 5221447e0bc6..c1f5175f631f 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -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 &get_sessions() const { return session_map; } - bool is_any_state(int state) { - map* >::iterator p = by_state.find(state); + bool is_any_state(int state) const { + map* >::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) {