]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: implement const SessionMap::get_session
authorJohn Spray <john.spray@redhat.com>
Wed, 10 Sep 2014 22:28:30 +0000 (23:28 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 17 Sep 2014 12:21:49 +0000 (13:21 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/SessionMap.h

index 283955890ae18d2a0b33bf12225e884e8e26eee2..b000c5ec227cd4b4034a29fa8ad8884dfe4aea0c 100644 (file)
@@ -303,6 +303,14 @@ public:
       return session_map[w];
     return 0;
   }
+  const Session* get_session(entity_name_t w) const {
+    ceph::unordered_map<entity_name_t, Session*>::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)) {