]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: do is_out test only if we do not collide 13326/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 9 Feb 2017 03:47:12 +0000 (11:47 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 10 Feb 2017 01:38:09 +0000 (09:38 +0800)
The is_out() test could requires additional hash, so we shall
skip it whenever it is possible.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/crush/mapper.c

index d2417e52a37a871c390774a08e458122baba31b1..db71fd76d3e0a2335a33890534d11d552911c3f0 100644 (file)
@@ -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: