]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdcap: whitespace to make grammar more readable
authorSage Weil <sage@inktank.com>
Wed, 13 Jun 2012 20:55:38 +0000 (13:55 -0700)
committerSage Weil <sage@inktank.com>
Wed, 13 Jun 2012 20:55:38 +0000 (13:55 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDCap.cc
src/osd/OSDCap.h

index 51219d07fc1425b84f276f70369f10cdf45a38ee..25adb6b8d4389c2b8a25166d37414485ee9722ff 100644 (file)
@@ -147,8 +147,8 @@ struct OSDCapParser : qi::grammar<Iterator, OSDCap(), ascii::space_type>
     // match := [pool <poolname> | uid <123>] [object_prefix <prefix>]
     pool_name %= -(lit("pool") >> str);
     object_prefix %= -(lit("object_prefix") >> str);
-    match = ( (lit("auid") >> int_ >> object_prefix)[_val = phoenix::construct<OSDCapMatch>(_1, _2)] |
-             (pool_name >> object_prefix)[_val = phoenix::construct<OSDCapMatch>(_1, _2)]);
+    match = ( (lit("auid") >> int_ >> object_prefix)   [_val = phoenix::construct<OSDCapMatch>(_1, _2)] |
+             (pool_name >> object_prefix)             [_val = phoenix::construct<OSDCapMatch>(_1, _2)]);
              
 
     // rwxa := * | [r][w][x]
@@ -161,15 +161,15 @@ struct OSDCapParser : qi::grammar<Iterator, OSDCap(), ascii::space_type>
 
     // capspec := * | rwx | class <name> [classcap]
     capspec =
-      rwxa[_val = phoenix::construct<OSDCapSpec>(_1)] |
-      ( lit("class") >> ((str >> str)[_val = phoenix::construct<OSDCapSpec>(_1, _2)] |
-                        str[_val = phoenix::construct<OSDCapSpec>(_1, string())] ));
+      rwxa                                            [_val = phoenix::construct<OSDCapSpec>(_1)] |
+      ( lit("class") >> ((str >> str)                 [_val = phoenix::construct<OSDCapSpec>(_1, _2)] |
+                        str                          [_val = phoenix::construct<OSDCapSpec>(_1, string())] ));
 
     // grant := allow match capspec
-    grant = lit("allow") >> ((match >> capspec)[_val = phoenix::construct<OSDCapGrant>(_1, _2)]);
+    grant = lit("allow") >> ((match >> capspec)       [_val = phoenix::construct<OSDCapGrant>(_1, _2)]);
 
     // osdcap := grant [grant ...]
-    osdcap %= (grant % (lit(';') | lit(',')))[_val = phoenix::construct<OSDCap>(_1)];
+    osdcap %= (grant % (lit(';') | lit(',')))         [_val = phoenix::construct<OSDCap>(_1)];
   }
   qi::rule<Iterator, unsigned(), ascii::space_type> rwxa;
   qi::rule<Iterator, string(), ascii::space_type> quoted_string;
index 8a81be39e37c9513d87b767ddecde54ff058b347..124c137176cca9eaea40d50df4ed617505ca3538 100644 (file)
@@ -58,8 +58,10 @@ ostream& operator<<(ostream& out, const OSDCapSpec& s);
 
 
 struct OSDCapMatch {
+  // auid and pool_name are mutually exclusive
   int64_t auid;
   std::string pool_name;
+
   std::string object_prefix;
 
   OSDCapMatch() : auid(CEPH_AUTH_UID_DEFAULT) {}