summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-02-16 09:21:15 -0500
committerIlya Dryomov <idryomov@gmail.com>2017-02-23 16:22:02 -0500
commit98ba6af728de99953e25e550dbeca588c258ef03 (patch)
tree3a49891c922e9058f5acbacd7a8b13dfb18c6993
parentdf963ea8a082d31521a120e8e31a29ad8a1dc215 (diff)
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 <idryomov@gmail.com>
-rw-r--r--net/ceph/crush/mapper.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index 2e31217ccae3..84d2de047865 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,
552 } 552 }
553 } 553 }
554 554
555 if (!reject) { 555 if (!reject && !collide) {
556 /* out? */ 556 /* out? */
557 if (itemtype == 0) 557 if (itemtype == 0)
558 reject = is_out(map, weight, 558 reject = is_out(map, weight,
559 weight_max, 559 weight_max,
560 item, x); 560 item, x);
561 else
562 reject = 0;
563 } 561 }
564 562
565reject: 563reject: