]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: relax the order by which rules and buckets must be defined
authorJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 30 Oct 2012 21:37:47 +0000 (21:37 +0000)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 27 Nov 2012 20:00:44 +0000 (20:00 +0000)
Before we only allowed buckets (say, 'root') to be defined *before*
rules.

With this patch, we allow buckets and rules to be defined by any order,
although some care should be taken when creating the plain-text crush
map, or the crushtool will error out when a rule uses a bucket only
defined later on in the file.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/crush/grammar.h

index c975e176a894457e2cc5e3a6392228358d091ead..bb37fed428c85bff3e4781e334b9db1c9ebda646 100644 (file)
@@ -138,7 +138,7 @@ struct crush_grammar : public grammar<crush_grammar>
                           >> '}';
 
       // the whole crush map
-      crushmap = *(tunable | device | bucket_type) >> *bucket >> *crushrule;
+      crushmap = *(tunable | device | bucket_type) >> *(bucket | crushrule);
     }
 
     rule<ScannerT, parser_context<>, parser_tag<_crushmap> > const&