From: Loic Dachary Date: Fri, 5 May 2017 09:38:32 +0000 (+0200) Subject: crush: update documentation for negative choose step X-Git-Tag: v12.0.3~68^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dca1ae1e0a6b02029c3a7f9dec4114972be26d50;p=ceph-ci.git crush: update documentation for negative choose step And remove an obsolete comment. Signed-off-by: Loic Dachary --- diff --git a/src/crush/builder.h b/src/crush/builder.h index 651729ff0e0..d2f4522a63e 100644 --- a/src/crush/builder.h +++ b/src/crush/builder.h @@ -87,10 +87,10 @@ extern struct crush_rule *crush_make_rule(int len, int ruleset, int type, int mi * __arg1__ leaves within all the buckets of type __arg2__ and * select them. * - * In all __CHOOSE__ steps, if __arg1__ is zero, the number of items - * to select is determined by the __max_result__ argument of - * crush_do_rule(), i.e. __arg1__ is __max_result__ minus the number of - * items already in the result. + * In all __CHOOSE__ steps, if __arg1__ is less than or equal to zero, + * the number of items to select is equal to the __max_result__ argument + * of crush_do_rule() minus __arg1__. It is common to set __arg1__ to zero + * to select as many items as requested by __max_result__. * * - __CRUSH_RULE_SET_CHOOSE_TRIES__ and __CRUSH_RULE_SET_CHOOSELEAF_TRIES__ * diff --git a/src/crush/mapper.c b/src/crush/mapper.c index 9fc06e89a31..8176efcea10 100644 --- a/src/crush/mapper.c +++ b/src/crush/mapper.c @@ -994,11 +994,6 @@ int crush_do_rule(const struct crush_map *map, for (i = 0; i < wsize; i++) { int bno; - /* - * see CRUSH_N, CRUSH_N_MINUS macros. - * basically, numrep <= 0 means relative to - * the provided result_max - */ numrep = curstep->arg1; if (numrep <= 0) { numrep += result_max;