From: Sage Weil Date: Fri, 14 Jul 2017 19:28:42 +0000 (-0400) Subject: crush/CrushWrapper: get_choose_args_positions helper X-Git-Tag: v12.1.2~150^2~23 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a243936f4cda9a9da3a00f57980a9d396ee84440;p=ceph-ci.git crush/CrushWrapper: get_choose_args_positions helper Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index dc94519981c..0835d79abdb 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -1452,6 +1452,16 @@ public: return choose_args_adjust_item_weight(cct, cmap, id, weight, ss); } + int get_choose_args_positions(crush_choose_arg_map cmap) { + // infer positions from other buckets + for (unsigned j = 0; j < cmap.size; ++j) { + if (cmap.args[j].weight_set_size) { + return cmap.args[j].weight_set_size; + } + } + return 1; + } + template void do_rule(int rule, int x, vector& out, int maxout, const WeightVector& weight,