From f428c2b5943a22f94dce2e18b9a97bcc30019cb5 Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Sun, 12 Jun 2016 20:48:07 +0100 Subject: [PATCH] mds/SessionMap.h: add const to member functions Signed-off-by: Michal Jarzabek --- src/mds/SessionMap.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) { -- 2.47.3