From: John Spray Date: Wed, 10 Sep 2014 22:28:30 +0000 (+0100) Subject: mds: implement const SessionMap::get_session X-Git-Tag: v0.86~63^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6320e53569f2a4ea02e723fdafa98b14750e113d;p=ceph.git mds: implement const SessionMap::get_session Signed-off-by: John Spray --- diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 283955890ae1..b000c5ec227c 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -303,6 +303,14 @@ public: return session_map[w]; return 0; } + const Session* get_session(entity_name_t w) const { + ceph::unordered_map::const_iterator p = session_map.find(w); + if (p == session_map.end()) { + return NULL; + } else { + return p->second; + } + } Session* get_or_add_session(const entity_inst_t& i) { Session *s; if (session_map.count(i.name)) {