Lines Matching refs:b
51 int b = 0; in calc_bits_of() local
54 b++; in calc_bits_of()
56 return b; in calc_bits_of()
72 struct crush_bucket_uniform *b) in crush_decode_uniform_bucket() argument
75 ceph_decode_need(p, end, (1+b->h.size) * sizeof(u32), bad); in crush_decode_uniform_bucket()
76 b->item_weight = ceph_decode_32(p); in crush_decode_uniform_bucket()
83 struct crush_bucket_list *b) in crush_decode_list_bucket() argument
87 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_list_bucket()
88 if (b->item_weights == NULL) in crush_decode_list_bucket()
90 b->sum_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_list_bucket()
91 if (b->sum_weights == NULL) in crush_decode_list_bucket()
93 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_list_bucket()
94 for (j = 0; j < b->h.size; j++) { in crush_decode_list_bucket()
95 b->item_weights[j] = ceph_decode_32(p); in crush_decode_list_bucket()
96 b->sum_weights[j] = ceph_decode_32(p); in crush_decode_list_bucket()
104 struct crush_bucket_tree *b) in crush_decode_tree_bucket() argument
108 ceph_decode_8_safe(p, end, b->num_nodes, bad); in crush_decode_tree_bucket()
109 b->node_weights = kcalloc(b->num_nodes, sizeof(u32), GFP_NOFS); in crush_decode_tree_bucket()
110 if (b->node_weights == NULL) in crush_decode_tree_bucket()
112 ceph_decode_need(p, end, b->num_nodes * sizeof(u32), bad); in crush_decode_tree_bucket()
113 for (j = 0; j < b->num_nodes; j++) in crush_decode_tree_bucket()
114 b->node_weights[j] = ceph_decode_32(p); in crush_decode_tree_bucket()
121 struct crush_bucket_straw *b) in crush_decode_straw_bucket() argument
125 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw_bucket()
126 if (b->item_weights == NULL) in crush_decode_straw_bucket()
128 b->straws = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw_bucket()
129 if (b->straws == NULL) in crush_decode_straw_bucket()
131 ceph_decode_need(p, end, 2 * b->h.size * sizeof(u32), bad); in crush_decode_straw_bucket()
132 for (j = 0; j < b->h.size; j++) { in crush_decode_straw_bucket()
133 b->item_weights[j] = ceph_decode_32(p); in crush_decode_straw_bucket()
134 b->straws[j] = ceph_decode_32(p); in crush_decode_straw_bucket()
142 struct crush_bucket_straw2 *b) in crush_decode_straw2_bucket() argument
146 b->item_weights = kcalloc(b->h.size, sizeof(u32), GFP_NOFS); in crush_decode_straw2_bucket()
147 if (b->item_weights == NULL) in crush_decode_straw2_bucket()
149 ceph_decode_need(p, end, b->h.size * sizeof(u32), bad); in crush_decode_straw2_bucket()
150 for (j = 0; j < b->h.size; j++) in crush_decode_straw2_bucket()
151 b->item_weights[j] = ceph_decode_32(p); in crush_decode_straw2_bucket()
407 __s32 b; in crush_finalize() local
413 for (b = 0; b < c->max_buckets; b++) { in crush_finalize()
414 if (!c->buckets[b]) in crush_finalize()
417 switch (c->buckets[b]->alg) { in crush_finalize()
427 c->working_size += c->buckets[b]->size * sizeof(__u32); in crush_finalize()
478 struct crush_bucket *b; in crush_decode() local
508 b = c->buckets[i] = kzalloc(size, GFP_NOFS); in crush_decode()
509 if (b == NULL) in crush_decode()
513 b->id = ceph_decode_32(p); in crush_decode()
514 b->type = ceph_decode_16(p); in crush_decode()
515 b->alg = ceph_decode_8(p); in crush_decode()
516 b->hash = ceph_decode_8(p); in crush_decode()
517 b->weight = ceph_decode_32(p); in crush_decode()
518 b->size = ceph_decode_32(p); in crush_decode()
521 b->size, (int)(*p-start), *p, end); in crush_decode()
523 b->items = kcalloc(b->size, sizeof(__s32), GFP_NOFS); in crush_decode()
524 if (b->items == NULL) in crush_decode()
527 ceph_decode_need(p, end, b->size*sizeof(u32), bad); in crush_decode()
528 for (j = 0; j < b->size; j++) in crush_decode()
529 b->items[j] = ceph_decode_32(p); in crush_decode()
531 switch (b->alg) { in crush_decode()
534 (struct crush_bucket_uniform *)b); in crush_decode()
540 (struct crush_bucket_list *)b); in crush_decode()
546 (struct crush_bucket_tree *)b); in crush_decode()
552 (struct crush_bucket_straw *)b); in crush_decode()
558 (struct crush_bucket_straw2 *)b); in crush_decode()
3036 struct crush_bucket *b; in get_immediate_parent() local
3041 b = c->buckets[i]; in get_immediate_parent()
3042 if (!b) in get_immediate_parent()
3046 cn = lookup_crush_name(&c->names, b->id); in get_immediate_parent()
3050 for (j = 0; j < b->size; j++) { in get_immediate_parent()
3051 if (b->items[j] != id) in get_immediate_parent()
3054 *parent_type_id = b->type; in get_immediate_parent()
3055 type_cn = lookup_crush_name(&c->type_names, b->type); in get_immediate_parent()
3058 return b->id; in get_immediate_parent()