]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crush: update documentation for negative choose step
authorLoic Dachary <ldachary@redhat.com>
Fri, 5 May 2017 09:38:32 +0000 (11:38 +0200)
committerLoic Dachary <ldachary@redhat.com>
Fri, 5 May 2017 13:39:26 +0000 (15:39 +0200)
And remove an obsolete comment.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/crush/builder.h
src/crush/mapper.c

index 651729ff0e06386726491b4528ab34c3ea47eed5..d2f4522a63ea601117d173d886502380a3c4370c 100644 (file)
@@ -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__
  *
index 9fc06e89a31f211755660fa348abcb1c17e24b21..8176efcea1023598db0700f7ba2b8cc58ab9718a 100644 (file)
@@ -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;