From db107cc7f15cf2481894add325dc93e33479f529 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 9 Feb 2017 11:47:12 +0800 Subject: [PATCH] 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 --- src/crush/mapper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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: -- 2.47.3