Loading include/linux/crush/crush.h +5 −0 Original line number Diff line number Diff line Loading @@ -166,4 +166,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 net/ceph/crush/crush.c +1 −3 Original line number Diff line number Diff line Loading @@ -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]; } Loading Loading
include/linux/crush/crush.h +5 −0 Original line number Diff line number Diff line Loading @@ -166,4 +166,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
net/ceph/crush/crush.c +1 −3 Original line number Diff line number Diff line Loading @@ -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]; } Loading