diff options
| author | Sage Weil <sage@inktank.com> | 2013-01-15 21:49:09 -0500 |
|---|---|---|
| committer | Alex Elder <elder@inktank.com> | 2013-01-17 13:42:39 -0500 |
| commit | 7d7c1f6136bac00174842f845babe7fb3483724e (patch) | |
| tree | e4334780995901e60cfacbfc53b5026993fcb02e | |
| parent | 1604f488ac2dcce33c8218e75a000e8c5fb57e61 (diff) | |
crush: avoid recursion if we have already collided
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>
| -rw-r--r-- | net/ceph/crush/mapper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 96c8a58937db..cbd06a91941c 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c | |||
| @@ -392,7 +392,7 @@ static int crush_choose(const struct crush_map *map, | |||
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | reject = 0; | 394 | reject = 0; |
| 395 | if (recurse_to_leaf) { | 395 | if (!collide && recurse_to_leaf) { |
| 396 | if (item < 0) { | 396 | if (item < 0) { |
| 397 | if (crush_choose(map, | 397 | if (crush_choose(map, |
| 398 | map->buckets[-1-item], | 398 | map->buckets[-1-item], |
