Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188566
b: refs/heads/master
c: b28813a
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil committed Oct 7, 2009
1 parent 391daa3 commit 6f82d00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b195befd9acb514dd2afb722e63fdd880ed63217
refs/heads/master: b28813a61d6ffe05ad353a86965607bb7a7fd60f
9 changes: 7 additions & 2 deletions trunk/fs/ceph/crush/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int crush_choose(struct crush_map *map,
struct crush_bucket *in = bucket;
int r;
int i;
int item;
int item = 0;
int itemtype;
int collide, reject;
const int orig_tries = 5; /* attempts before we fall back to search */
Expand All @@ -316,6 +316,7 @@ static int crush_choose(struct crush_map *map,
/* choose through intervening buckets */
flocal = 0;
do {
collide = 0;
retry_bucket = 0;
r = rep;
if (in->alg == CRUSH_BUCKET_UNIFORM) {
Expand All @@ -340,6 +341,10 @@ static int crush_choose(struct crush_map *map,
}

/* bucket choose */
if (in->size == 0) {
reject = 1;
goto reject;
}
if (flocal >= (in->size>>1) &&
flocal > orig_tries)
item = bucket_perm_choose(in, x, r);
Expand All @@ -363,7 +368,6 @@ static int crush_choose(struct crush_map *map,
}

/* collision? */
collide = 0;
for (i = 0; i < outpos; i++) {
if (out[i] == item) {
collide = 1;
Expand All @@ -388,6 +392,7 @@ static int crush_choose(struct crush_map *map,
reject = 0;
}

reject:
if (reject || collide) {
ftotal++;
flocal++;
Expand Down

0 comments on commit 6f82d00

Please sign in to comment.