From: xie xingguo Date: Thu, 9 Feb 2017 03:47:12 +0000 (+0800) Subject: crush: do is_out test only if we do not collide X-Git-Tag: v12.0.1~405^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13326%2Fhead;p=ceph.git crush: do is_out test only if we do not collide The is_out() test could requires additional hash, so we shall skip it whenever it is possible. Signed-off-by: xie xingguo --- diff --git a/src/crush/mapper.c b/src/crush/mapper.c index d2417e52a37..db71fd76d3e 100644 --- a/src/crush/mapper.c +++ b/src/crush/mapper.c @@ -548,17 +548,15 @@ parent_r %d stable %d\n", } else { /* we already have a leaf! */ out2[outpos] = item; - } + } } - if (!reject) { + if (!reject && !collide) { /* out? */ if (itemtype == 0) reject = is_out(map, weight, weight_max, item, x); - else - reject = 0; } reject: