Lines Matching refs:b
35 int b = 0; in calc_bits_of() local
38 b++; in calc_bits_of()
40 return b; in calc_bits_of()
56 struct crush_bucket_uniform *b) in crush_decode_uniform_bucket() argument
59 ceph_decode_need(p, end, (1+b->h.size) * sizeof(u32), bad); in crush_decode_uniform_bucket()
60 b->item_weight = ceph_decode_32(p); in crush_decode_uniform_bucket()
67 struct crush_bucket_list *b) in crush_decode_list_bucket() argument
71 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_list_bucket()
72 if (b->item_weights == NULL) in crush_decode_list_bucket()
74 b->sum_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_list_bucket()
75 if (b->sum_weights == NULL) in crush_decode_list_bucket()
77 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_list_bucket()
78 for (j = 0; j < b->h.size; j++) { in crush_decode_list_bucket()
79 b->item_weights[j] = ceph_decode_32(p); in crush_decode_list_bucket()
80 b->sum_weights[j] = ceph_decode_32(p); in crush_decode_list_bucket()
88 struct crush_bucket_tree *b) in crush_decode_tree_bucket() argument
92 ceph_decode_8_safe(p, end, b->num_nodes, bad); in crush_decode_tree_bucket()
93 b->node_weights = kcalloc(b->num_nodes, sizeof(u32), GFP_NOFS); in crush_decode_tree_bucket()
94 if (b->node_weights == NULL) in crush_decode_tree_bucket()
96 ceph_decode_need(p, end, b->num_nodes * sizeof(u32), bad); in crush_decode_tree_bucket()
97 for (j = 0; j < b->num_nodes; j++) in crush_decode_tree_bucket()
98 b->node_weights[j] = ceph_decode_32(p); in crush_decode_tree_bucket()
105 struct crush_bucket_straw *b) in crush_decode_straw_bucket() argument
109 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw_bucket()
110 if (b->item_weights == NULL) in crush_decode_straw_bucket()
112 b->straws = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw_bucket()
113 if (b->straws == NULL) in crush_decode_straw_bucket()
115 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_straw_bucket()
116 for (j = 0; j < b->h.size; j++) { in crush_decode_straw_bucket()
117 b->item_weights[j] = ceph_decode_32(p); in crush_decode_straw_bucket()
118 b->straws[j] = ceph_decode_32(p); in crush_decode_straw_bucket()
126 struct crush_bucket_straw2 *b) in crush_decode_straw2_bucket() argument
130 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw2_bucket()
131 if (b->item_weights == NULL) in crush_decode_straw2_bucket()
133 ceph_decode_need(p, end, b->h.size * sizeof(u32), bad); in crush_decode_straw2_bucket()
134 for (j = 0; j < b->h.size; j++) in crush_decode_straw2_bucket()
135 b->item_weights[j] = ceph_decode_32(p); in crush_decode_straw2_bucket()
391 __s32 b; in crush_finalize() local
397 for (b = 0; b < c->max_buckets; b++) { in crush_finalize()
398 if (!c->buckets[b]) in crush_finalize()
401 switch (c->buckets[b]->alg) { in crush_finalize()
411 c->working_size += c->buckets[b]->size * sizeof(__u32); in crush_finalize()
462 struct crush_bucket *b; in crush_decode() local
492 b = c->buckets[i] = kzalloc(size, GFP_NOFS); in crush_decode()
493 if (b == NULL) in crush_decode()
497 b->id = ceph_decode_32(p); in crush_decode()
498 b->type = ceph_decode_16(p); in crush_decode()
499 b->alg = ceph_decode_8(p); in crush_decode()
500 b->hash = ceph_decode_8(p); in crush_decode()
501 b->weight = ceph_decode_32(p); in crush_decode()
502 b->size = ceph_decode_32(p); in crush_decode()
505 b->size, (int)(*p-start), *p, end); in crush_decode()
507 b->items = kcalloc(b->size, sizeof(__s32), GFP_NOFS); in crush_decode()
508 if (b->items == NULL) in crush_decode()
511 ceph_decode_need(p, end, b->size*sizeof(u32), bad); in crush_decode()
512 for (j = 0; j < b->size; j++) in crush_decode()
513 b->items[j] = ceph_decode_32(p); in crush_decode()
515 switch (b->alg) { in crush_decode()
518 (struct crush_bucket_uniform *)b); in crush_decode()
524 (struct crush_bucket_list *)b); in crush_decode()
530 (struct crush_bucket_tree *)b); in crush_decode()
536 (struct crush_bucket_straw *)b); in crush_decode()
542 (struct crush_bucket_straw2 *)b); in crush_decode()
3001 struct crush_bucket *b; in get_immediate_parent() local
3006 b = c->buckets[i]; in get_immediate_parent()
3007 if (!b) in get_immediate_parent()
3011 cn = lookup_crush_name(&c->names, b->id); in get_immediate_parent()
3015 for (j = 0; j < b->size; j++) { in get_immediate_parent()
3016 if (b->items[j] != id) in get_immediate_parent()
3019 *parent_type_id = b->type; in get_immediate_parent()
3020 type_cn = lookup_crush_name(&c->type_names, b->type); in get_immediate_parent()
3023 return b->id; in get_immediate_parent()