aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crush
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-24 14:19:24 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 13:32:14 -0500
commite8ef19c4ad161768e1d8309d5ae18481c098eb81 (patch)
tree9ba7cd6965c530228085fba2bf23dcc132ea94d3 /net/ceph/crush
parent2a4ba74ef67ad3a1645d78487ed7ccd0f40063c0 (diff)
crush: eliminate CRUSH_MAX_SET result size limitation
This is only present to size the temporary scratch arrays that we put on the stack. Let the caller allocate them as they wish and remove the limitation. Reflects ceph.git commit 1cfe140bf2dab99517589a82a916f4c75b9492d1. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/crush')
-rw-r--r--net/ceph/crush/mapper.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index 82cab7d3e89d..dcf48bc504ea 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -478,15 +478,17 @@ reject:
478 * @result_max: maximum result size 478 * @result_max: maximum result size
479 * @weight: weight vector (for map leaves) 479 * @weight: weight vector (for map leaves)
480 * @weight_max: size of weight vector 480 * @weight_max: size of weight vector
481 * @scratch: scratch vector for private use; must be >= 3 * result_max
481 */ 482 */
482int crush_do_rule(const struct crush_map *map, 483int crush_do_rule(const struct crush_map *map,
483 int ruleno, int x, int *result, int result_max, 484 int ruleno, int x, int *result, int result_max,
484 const __u32 *weight, int weight_max) 485 const __u32 *weight, int weight_max,
486 int *scratch)
485{ 487{
486 int result_len; 488 int result_len;
487 int a[CRUSH_MAX_SET]; 489 int *a = scratch;
488 int b[CRUSH_MAX_SET]; 490 int *b = scratch + result_max;
489 int c[CRUSH_MAX_SET]; 491 int *c = scratch + result_max*2;
490 int recurse_to_leaf; 492 int recurse_to_leaf;
491 int *w; 493 int *w;
492 int wsize = 0; 494 int wsize = 0;