aboutsummaryrefslogtreecommitdiff
path: root/net/ceph/crush
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-07 15:36:49 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-26 11:38:03 -0800
commit9a0117ae53308d0d8284ba5664ed4c1d0ec54176 (patch)
treefa01a51137fbb7785b485ff4940c6d24fc5685aa /net/ceph/crush
parent20501b9e6e1db8e7ab6668ef15d697b1c057a50a (diff)
crush: fix tree node weight lookup
(cherry picked from commit f671d4cd9b36691ac4ef42cde44c1b7a84e13631) Fix the node weight lookup for tree buckets by using a correct accessor. Reflects ceph.git commit d287ade5bcbdca82a3aef145b92924cf1e856733. Reviewed-by: Alex Elder <elder@inktank.com> Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ceph/crush')
-rw-r--r--net/ceph/crush/crush.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ceph/crush/crush.c b/net/ceph/crush/crush.c
index 8dd19a0deedc..f23611d0cdee 100644
--- a/net/ceph/crush/crush.c
+++ b/net/ceph/crush/crush.c
@@ -37,9 +37,7 @@ int crush_get_bucket_item_weight(const struct crush_bucket *b, int p)
case CRUSH_BUCKET_LIST:
return ((struct crush_bucket_list *)b)->item_weights[p];
case CRUSH_BUCKET_TREE:
- if (p & 1)
- return ((struct crush_bucket_tree *)b)->node_weights[p];
- return 0;
+ return ((struct crush_bucket_tree *)b)->node_weights[crush_calc_tree_node(p)];
case CRUSH_BUCKET_STRAW:
return ((struct crush_bucket_straw *)b)->item_weights[p];
}