Commit 98ba6af7 authored by Ilya Dryomov's avatar Ilya Dryomov

crush: do is_out test only if we do not collide

The is_out() test may require an additional hashing operation, so we
should skip it whenever possible.

Reflects ceph.git commit db107cc7f15cf2481894add325dc93e33479f529.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent df963ea8
...@@ -552,14 +552,12 @@ static int crush_choose_firstn(const struct crush_map *map, ...@@ -552,14 +552,12 @@ static int crush_choose_firstn(const struct crush_map *map,
} }
} }
if (!reject) { if (!reject && !collide) {
/* out? */ /* out? */
if (itemtype == 0) if (itemtype == 0)
reject = is_out(map, weight, reject = is_out(map, weight,
weight_max, weight_max,
item, x); item, x);
else
reject = 0;
} }
reject: reject:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment