summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/crush/crush.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 3f50369a50e8..e7a8c9055cb2 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -177,4 +177,9 @@ extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b);
extern void crush_destroy_bucket(struct crush_bucket *b);
extern void crush_destroy(struct crush_map *map);
+static inline int crush_calc_tree_node(int i)
+{
+ return ((i+1) << 1)-1;
+}
+
#endif