Lines Matching +full:1 +full:g
26 struct bch_disk_group *g, *sorted = NULL; in bch2_sb_disk_groups_validate() local
38 group_id = BCH_MEMBER_GROUP(&m) - 1; in bch2_sb_disk_groups_validate()
56 g = groups->entries + i; in bch2_sb_disk_groups_validate()
58 if (BCH_GROUP_DELETED(g)) in bch2_sb_disk_groups_validate()
61 len = strnlen(g->label, sizeof(g->label)); in bch2_sb_disk_groups_validate()
75 for (g = sorted; g + 1 < sorted + nr_groups; g++) in bch2_sb_disk_groups_validate()
76 if (!BCH_GROUP_DELETED(g) && in bch2_sb_disk_groups_validate()
77 !group_cmp(&g[0], &g[1])) { in bch2_sb_disk_groups_validate()
79 BCH_GROUP_PARENT(g), in bch2_sb_disk_groups_validate()
80 (int) sizeof(g->label), g->label); in bch2_sb_disk_groups_validate()
94 struct bch_disk_groups_cpu *g = rcu_dereference(c->disk_groups); in bch2_disk_groups_to_text() local
95 if (!g) in bch2_disk_groups_to_text()
98 for (unsigned i = 0; i < g->nr; i++) { in bch2_disk_groups_to_text()
102 if (g->entries[i].deleted) { in bch2_disk_groups_to_text()
107 prt_printf(out, "[parent %d devs", g->entries[i].parent); in bch2_disk_groups_to_text()
108 for_each_member_device_rcu(c, ca, &g->entries[i].devs) in bch2_disk_groups_to_text()
124 struct bch_disk_group *g; in bch2_sb_disk_groups_to_text() local
127 for (g = groups->entries; in bch2_sb_disk_groups_to_text()
128 g < groups->entries + nr_groups; in bch2_sb_disk_groups_to_text()
129 g++) { in bch2_sb_disk_groups_to_text()
130 if (g != groups->entries) in bch2_sb_disk_groups_to_text()
133 if (BCH_GROUP_DELETED(g)) in bch2_sb_disk_groups_to_text()
137 BCH_GROUP_PARENT(g), g->label); in bch2_sb_disk_groups_to_text()
150 unsigned i, g, nr_groups; in bch2_sb_disk_groups_to_cpu() local
182 g = BCH_MEMBER_GROUP(&m); in bch2_sb_disk_groups_to_cpu()
183 while (g) { in bch2_sb_disk_groups_to_cpu()
184 dst = &cpu_g->entries[g - 1]; in bch2_sb_disk_groups_to_cpu()
186 g = dst->parent; in bch2_sb_disk_groups_to_cpu()
218 struct bch_disk_groups_cpu *g = rcu_dereference(c->disk_groups); in bch2_target_to_mask() local
220 devs = g && t.group < g->nr && !g->entries[t.group].deleted in bch2_target_to_mask()
221 ? &g->entries[t.group].devs in bch2_target_to_mask()
244 struct bch_disk_groups_cpu *g; in bch2_dev_in_target() local
249 g = rcu_dereference(c->disk_groups); in bch2_dev_in_target()
250 m = g && t.group < g->nr && !g->entries[t.group].deleted in bch2_dev_in_target()
251 ? &g->entries[t.group].devs in bch2_dev_in_target()
274 struct bch_disk_group *g = groups->entries + i; in __bch2_disk_group_find() local
276 if (BCH_GROUP_DELETED(g)) in __bch2_disk_group_find()
279 if (!BCH_GROUP_DELETED(g) && in __bch2_disk_group_find()
280 BCH_GROUP_PARENT(g) == parent && in __bch2_disk_group_find()
281 strnlen(g->label, sizeof(g->label)) == namelen && in __bch2_disk_group_find()
282 !memcmp(name, g->label, namelen)) in __bch2_disk_group_find()
286 return -1; in __bch2_disk_group_find()
295 struct bch_disk_group *g; in __bch2_disk_group_add() local
308 sizeof(struct bch_disk_group) * (nr_groups + 1)) / in __bch2_disk_group_add()
320 g = &groups->entries[i]; in __bch2_disk_group_add()
322 memcpy(g->label, name, namelen); in __bch2_disk_group_add()
323 if (namelen < sizeof(g->label)) in __bch2_disk_group_add()
324 g->label[namelen] = '\0'; in __bch2_disk_group_add()
325 SET_BCH_GROUP_DELETED(g, 0); in __bch2_disk_group_add()
326 SET_BCH_GROUP_PARENT(g, parent); in __bch2_disk_group_add()
327 SET_BCH_GROUP_DATA_ALLOWED(g, ~0); in __bch2_disk_group_add()
336 int v = -1; in bch2_disk_path_find()
345 v = __bch2_disk_group_find(groups, v + 1, name, len); in bch2_disk_path_find()
356 int v = -1; in bch2_disk_path_find_or_create()
373 parent = v + 1; in bch2_disk_path_find_or_create()
383 struct bch_disk_group_cpu *g; in bch2_disk_path_to_text() local
393 while (1) { in bch2_disk_path_to_text()
400 g = groups->entries + v; in bch2_disk_path_to_text()
402 if (g->deleted) in bch2_disk_path_to_text()
407 if (!g->parent) in bch2_disk_path_to_text()
410 v = g->parent - 1; in bch2_disk_path_to_text()
415 g = groups->entries + v; in bch2_disk_path_to_text()
417 prt_printf(out, "%.*s", (int) sizeof(g->label), g->label); in bch2_disk_path_to_text()
434 struct bch_disk_group *g; in bch2_disk_path_to_text_sb() local
438 while (1) { in bch2_disk_path_to_text_sb()
445 g = groups->entries + v; in bch2_disk_path_to_text_sb()
447 if (BCH_GROUP_DELETED(g)) in bch2_disk_path_to_text_sb()
452 if (!BCH_GROUP_PARENT(g)) in bch2_disk_path_to_text_sb()
455 v = BCH_GROUP_PARENT(g) - 1; in bch2_disk_path_to_text_sb()
460 g = groups->entries + v; in bch2_disk_path_to_text_sb()
462 prt_printf(out, "%.*s", (int) sizeof(g->label), g->label); in bch2_disk_path_to_text_sb()
474 int ret, v = -1; in __bch2_dev_group_set()
488 SET_BCH_MEMBER_GROUP(mi, v + 1); in __bch2_dev_group_set()
508 int g; in bch2_opt_target_parse() local
530 g = bch2_disk_path_find(&c->disk_sb, val); in bch2_opt_target_parse()
533 if (g >= 0) { in bch2_opt_target_parse()
534 *res = group_to_target(g); in bch2_opt_target_parse()