From: Ilya Dryomov Date: Thu, 16 Feb 2017 14:21:15 +0000 (+0100) Subject: crush: do is_out test only if we do not collide X-Git-Tag: v4.14-rc1~1386^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98ba6af728de99953e25e550dbeca588c258ef03;p=platform%2Fkernel%2Flinux-rpi.git 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: Ilya Dryomov --- diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 2e31217..84d2de0 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -552,14 +552,12 @@ static int crush_choose_firstn(const struct crush_map *map, } } - if (!reject) { + if (!reject && !collide) { /* out? */ if (itemtype == 0) reject = is_out(map, weight, weight_max, item, x); - else - reject = 0; } reject: