summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ceph/crush/mapper.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index e3ade074541c..c34320518c8b 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -299,6 +299,8 @@ static int crush_choose_firstn(const struct crush_map *map,
const __u32 *weight, int weight_max,
int x, int numrep, int type,
int *out, int outpos,
+ unsigned int attempts,
+ unsigned int recurse_attempts,
int recurse_to_leaf,
int descend_once, int *out2)
{
@@ -385,6 +387,7 @@ static int crush_choose_firstn(const struct crush_map *map,
weight, weight_max,
x, outpos+1, 0,
out2, outpos,
+ recurse_attempts, 0,
0,
map->chooseleaf_descend_once,
NULL) <= outpos)
@@ -421,7 +424,7 @@ reject:
flocal <= in->size + map->choose_local_fallback_tries)
/* exhaustive bucket search */
retry_bucket = 1;
- else if (ftotal <= map->choose_total_tries)
+ else if (ftotal <= attempts)
/* then retry descent */
retry_descent = 1;
else
@@ -634,7 +637,8 @@ int crush_do_rule(const struct crush_map *map,
__u32 step;
int i, j;
int numrep;
- int choose_leaf_tries = 1;
+ int choose_tries = map->choose_total_tries;
+ int choose_leaf_tries = 0;
const int descend_once = 0;
if ((__u32)ruleno >= map->max_rules) {
@@ -701,6 +705,8 @@ int crush_do_rule(const struct crush_map *map,
x, numrep,
curstep->arg2,
o+osize, j,
+ choose_tries,
+ choose_leaf_tries ? choose_leaf_tries : choose_tries,
recurse_to_leaf,
descend_once, c+osize);
} else {
@@ -711,8 +717,8 @@ int crush_do_rule(const struct crush_map *map,
x, numrep, numrep,
curstep->arg2,
o+osize, j,
- map->choose_total_tries,
- choose_leaf_tries,
+ choose_tries,
+ choose_leaf_tries ? choose_leaf_tries : 1,
recurse_to_leaf,
c+osize,
0);