Lines Matching refs:b
27 int crush_get_bucket_item_weight(const struct crush_bucket *b, int p) in crush_get_bucket_item_weight() argument
29 if ((__u32)p >= b->size) in crush_get_bucket_item_weight()
32 switch (b->alg) { in crush_get_bucket_item_weight()
34 return ((struct crush_bucket_uniform *)b)->item_weight; in crush_get_bucket_item_weight()
36 return ((struct crush_bucket_list *)b)->item_weights[p]; in crush_get_bucket_item_weight()
38 return ((struct crush_bucket_tree *)b)->node_weights[crush_calc_tree_node(p)]; in crush_get_bucket_item_weight()
40 return ((struct crush_bucket_straw *)b)->item_weights[p]; in crush_get_bucket_item_weight()
42 return ((struct crush_bucket_straw2 *)b)->item_weights[p]; in crush_get_bucket_item_weight()
47 void crush_destroy_bucket_uniform(struct crush_bucket_uniform *b) in crush_destroy_bucket_uniform() argument
49 kfree(b->h.items); in crush_destroy_bucket_uniform()
50 kfree(b); in crush_destroy_bucket_uniform()
53 void crush_destroy_bucket_list(struct crush_bucket_list *b) in crush_destroy_bucket_list() argument
55 kfree(b->item_weights); in crush_destroy_bucket_list()
56 kfree(b->sum_weights); in crush_destroy_bucket_list()
57 kfree(b->h.items); in crush_destroy_bucket_list()
58 kfree(b); in crush_destroy_bucket_list()
61 void crush_destroy_bucket_tree(struct crush_bucket_tree *b) in crush_destroy_bucket_tree() argument
63 kfree(b->h.items); in crush_destroy_bucket_tree()
64 kfree(b->node_weights); in crush_destroy_bucket_tree()
65 kfree(b); in crush_destroy_bucket_tree()
68 void crush_destroy_bucket_straw(struct crush_bucket_straw *b) in crush_destroy_bucket_straw() argument
70 kfree(b->straws); in crush_destroy_bucket_straw()
71 kfree(b->item_weights); in crush_destroy_bucket_straw()
72 kfree(b->h.items); in crush_destroy_bucket_straw()
73 kfree(b); in crush_destroy_bucket_straw()
76 void crush_destroy_bucket_straw2(struct crush_bucket_straw2 *b) in crush_destroy_bucket_straw2() argument
78 kfree(b->item_weights); in crush_destroy_bucket_straw2()
79 kfree(b->h.items); in crush_destroy_bucket_straw2()
80 kfree(b); in crush_destroy_bucket_straw2()
83 void crush_destroy_bucket(struct crush_bucket *b) in crush_destroy_bucket() argument
85 switch (b->alg) { in crush_destroy_bucket()
87 crush_destroy_bucket_uniform((struct crush_bucket_uniform *)b); in crush_destroy_bucket()
90 crush_destroy_bucket_list((struct crush_bucket_list *)b); in crush_destroy_bucket()
93 crush_destroy_bucket_tree((struct crush_bucket_tree *)b); in crush_destroy_bucket()
96 crush_destroy_bucket_straw((struct crush_bucket_straw *)b); in crush_destroy_bucket()
99 crush_destroy_bucket_straw2((struct crush_bucket_straw2 *)b); in crush_destroy_bucket()
112 __s32 b; in crush_destroy() local
113 for (b = 0; b < map->max_buckets; b++) { in crush_destroy()
114 if (map->buckets[b] == NULL) in crush_destroy()
116 crush_destroy_bucket(map->buckets[b]); in crush_destroy()
123 __u32 b; in crush_destroy() local
124 for (b = 0; b < map->max_rules; b++) in crush_destroy()
125 crush_destroy_rule(map->rules[b]); in crush_destroy()