Skip to content

Commit

Permalink
crush: avoid recursion if we have already collided
Browse files Browse the repository at this point in the history
This saves us some cycles, but does not affect the placement result at
all.

This corresponds to ceph.git commit 4abb53d4f.

Signed-off-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Sage Weil authored and Alex Elder committed Jan 17, 2013
1 parent 1604f48 commit 7d7c1f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ceph/crush/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ static int crush_choose(const struct crush_map *map,
}

reject = 0;
if (recurse_to_leaf) {
if (!collide && recurse_to_leaf) {
if (item < 0) {
if (crush_choose(map,
map->buckets[-1-item],
Expand Down

0 comments on commit 7d7c1f6

Please sign in to comment.