From: Greg Farnum Date: Thu, 4 Mar 2010 02:40:22 +0000 (-0800) Subject: osd: mon: caps store auth_uid as an int for fast checking X-Git-Tag: v0.20~349 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08e21ca094859143955f1c2acbef0a1451bcab90;p=ceph.git osd: mon: caps store auth_uid as an int for fast checking --- diff --git a/src/mon/MonCaps.cc b/src/mon/MonCaps.cc index 3a4a6d3af02a..81775e1f45e1 100644 --- a/src/mon/MonCaps.cc +++ b/src/mon/MonCaps.cc @@ -125,7 +125,10 @@ do { \ } while (0) if (get_next_token(s, pos, token)) { - if (token.compare("=") == 0) { + if(token.compare("auth_uid") == 0) { + get_next_token(s, pos, token); + auth_uid = strtol(token.c_str(), NULL, 0); + } else if (token.compare("=") == 0) { ASSERT_STATE(any_cmd); got_eq = true; } else if (token.compare("allow") == 0) { diff --git a/src/mon/MonCaps.h b/src/mon/MonCaps.h index 7d8d18ae872a..2c6d9df17c38 100644 --- a/src/mon/MonCaps.h +++ b/src/mon/MonCaps.h @@ -37,6 +37,7 @@ class MonCaps { string text; rwx_t default_action; map services_map; + __u64 auth_uid; bool get_next_token(string s, size_t& pos, string& token); bool is_rwx(string& token, rwx_t& cap_val); int get_service_id(string& token); diff --git a/src/osd/OSDCaps.cc b/src/osd/OSDCaps.cc index 74fe4f3f68d6..8c65ecede773 100644 --- a/src/osd/OSDCaps.cc +++ b/src/osd/OSDCaps.cc @@ -99,7 +99,10 @@ do { \ } while (0) if (get_next_token(s, pos, token)) { - if (token.compare("=") == 0) { + if (token.compare("auth_uid") == 0) { + get_next_token(s, pos, token); + auth_uid = strtol(token.c_str(), NULL, 10); + } else if (token.compare("=") == 0) { ASSERT_STATE(any_cmd); got_eq = true; } else if (token.compare("allow") == 0) {