]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: mon: caps store auth_uid as an int for fast checking
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 4 Mar 2010 02:40:22 +0000 (18:40 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 4 Mar 2010 03:48:23 +0000 (19:48 -0800)
src/mon/MonCaps.cc
src/mon/MonCaps.h
src/osd/OSDCaps.cc

index 3a4a6d3af02aaf6a4912e86140d626b26cac0db3..81775e1f45e12867bb511580ea741467fd8fc449 100644 (file)
@@ -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) {
index 7d8d18ae872afc74689d5c5f045f41bc2994e7b7..2c6d9df17c38f906a4f908575d582f6c364874ed 100644 (file)
@@ -37,6 +37,7 @@ class MonCaps {
   string text;
   rwx_t default_action;
   map<int, MonServiceCap> 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);
index 74fe4f3f68d6aee29febc4d6626c15f1e3cd4ec8..8c65ecede7738423e6ee05acfad1c045d27a3fca 100644 (file)
@@ -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) {