summaryrefslogtreecommitdiff
path: root/src/crush/grammar.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2008-09-18 13:10:14 -0700
committerSage Weil <sage@newdream.net>2008-09-18 13:10:14 -0700
commit52f9d15826a34933b6516cef37ab5902949cf0c1 (patch)
treedf74cc9003f5f48ce0210ee7aa6570b923350f78 /src/crush/grammar.h
parentfb8cf71e27644bd4b6112b45a098aa0ef1770a18 (diff)
downloadceph-52f9d15826a34933b6516cef37ab5902949cf0c1.tar.gz
crushtool: fix chooseleaf compilation/decompilation
Diffstat (limited to 'src/crush/grammar.h')
-rw-r--r--src/crush/grammar.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/crush/grammar.h b/src/crush/grammar.h
index 090d0c75c8b..cfd34cf82bf 100644
--- a/src/crush/grammar.h
+++ b/src/crush/grammar.h
@@ -38,6 +38,7 @@ struct crush_grammar : public grammar<crush_grammar>
static const int _step_take = 18;
static const int _step_choose = 19;
+ static const int _step_chooseleaf = 20;
static const int _step_emit = 21;
static const int _step = 22;
static const int _crushrule = 23;
@@ -63,6 +64,7 @@ struct crush_grammar : public grammar<crush_grammar>
rule<ScannerT, parser_context<>, parser_tag<_step_take> > step_take;
rule<ScannerT, parser_context<>, parser_tag<_step_choose> > step_choose;
+ rule<ScannerT, parser_context<>, parser_tag<_step_chooseleaf> > step_chooseleaf;
rule<ScannerT, parser_context<>, parser_tag<_step_emit> > step_emit;
rule<ScannerT, parser_context<>, parser_tag<_step> > step;
rule<ScannerT, parser_context<>, parser_tag<_crushrule> > crushrule;
@@ -101,13 +103,18 @@ struct crush_grammar : public grammar<crush_grammar>
// rules
step_take = str_p("take") >> str_p("root");
- step_choose = (str_p("choose") | str_p("chooseleaf"))
+ step_choose = str_p("choose")
+ >> ( str_p("indep") | str_p("firstn") )
+ >> integer
+ >> str_p("type") >> name;
+ step_chooseleaf = str_p("chooseleaf")
>> ( str_p("indep") | str_p("firstn") )
>> integer
>> str_p("type") >> name;
step_emit = str_p("emit");
step = str_p("step") >> ( step_take |
step_choose |
+ step_chooseleaf |
step_emit );
crushrule = str_p("rule") >> !name >> '{'
>> str_p("pool") >> posint