From 08e21ca094859143955f1c2acbef0a1451bcab90 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Wed, 3 Mar 2010 18:40:22 -0800 Subject: [PATCH] osd: mon: caps store auth_uid as an int for fast checking --- src/mon/MonCaps.cc | 5 ++++- src/mon/MonCaps.h | 1 + src/osd/OSDCaps.cc | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mon/MonCaps.cc b/src/mon/MonCaps.cc index 3a4a6d3af02aa..81775e1f45e12 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 7d8d18ae872af..2c6d9df17c38f 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 74fe4f3f68d6a..8c65ecede7738 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) { -- 2.39.5