aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crush
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-05-07 18:36:49 -0400
committerSage Weil <sage@inktank.com>2012-05-07 18:39:35 -0400
commitf671d4cd9b36691ac4ef42cde44c1b7a84e13631 (patch)
tree9f961d2a6dfdee4ffa3b4c8d2b7308dfda85e177 /net/ceph/crush
parentfc7c3ae5ab9246ad96aab4d0d57f67e9255cfb56 (diff)
crush: fix tree node weight lookup
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>
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 2160791acf03..b93575f4eb13 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)
37 case CRUSH_BUCKET_LIST: 37 case CRUSH_BUCKET_LIST:
38 return ((struct crush_bucket_list *)b)->item_weights[p]; 38 return ((struct crush_bucket_list *)b)->item_weights[p];
39 case CRUSH_BUCKET_TREE: 39 case CRUSH_BUCKET_TREE:
40 if (p & 1) 40 return ((struct crush_bucket_tree *)b)->node_weights[crush_calc_tree_node(p)];
41 return ((struct crush_bucket_tree *)b)->node_weights[p];
42 return 0;
43 case CRUSH_BUCKET_STRAW: 41 case CRUSH_BUCKET_STRAW:
44 return ((struct crush_bucket_straw *)b)->item_weights[p]; 42 return ((struct crush_bucket_straw *)b)->item_weights[p];
45 } 43 }