Lines Matching refs:pg
35 struct priority_group *pg; /* Owning PG */ member
149 struct priority_group *pg; in alloc_priority_group() local
151 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
153 if (pg) in alloc_priority_group()
154 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
156 return pg; in alloc_priority_group()
173 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
176 struct path_selector *ps = &pg->ps; in free_priority_group()
183 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
184 kfree(pg); in free_priority_group()
215 struct priority_group *pg, *tmp; in free_multipath() local
217 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
218 list_del(&pg->list); in free_multipath()
219 free_priority_group(pg, m->ti); in free_multipath()
285 m->current_pg = pgpath->pg; in __switch_pg()
299 static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg, in __choose_path_in_pg() argument
304 path = pg->ps.type->select_path(&pg->ps, &m->repeat_count, nr_bytes); in __choose_path_in_pg()
310 if (m->current_pg != pg) in __choose_path_in_pg()
318 struct priority_group *pg; in __choose_pgpath() local
328 pg = m->next_pg; in __choose_pgpath()
330 if (!__choose_path_in_pg(m, pg, nr_bytes)) in __choose_pgpath()
345 list_for_each_entry(pg, &m->priority_groups, list) { in __choose_pgpath()
346 if (pg->bypassed == bypassed) in __choose_pgpath()
348 if (!__choose_path_in_pg(m, pg, nr_bytes)) { in __choose_pgpath()
442 if (pgpath->pg->ps.type->start_io) in __multipath_map()
443 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map()
517 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
540 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
547 pg->ps.type = pst; in parse_path_selector()
657 struct priority_group *pg; in parse_priority_group() local
666 pg = alloc_priority_group(); in parse_priority_group()
667 if (!pg) { in parse_priority_group()
671 pg->m = m; in parse_priority_group()
673 r = parse_path_selector(as, pg, ti); in parse_priority_group()
680 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
689 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
702 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
708 pgpath->pg = pg; in parse_priority_group()
709 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
713 return pg; in parse_priority_group()
716 free_priority_group(pg, ti); in parse_priority_group()
873 struct priority_group *pg; in multipath_ctr() local
875 pg = parse_priority_group(&as, m); in multipath_ctr()
876 if (IS_ERR(pg)) { in multipath_ctr()
877 r = PTR_ERR(pg); in multipath_ctr()
881 m->nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
882 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
884 pg->pg_num = pg_count; in multipath_ctr()
886 m->next_pg = pg; in multipath_ctr()
962 struct multipath *m = pgpath->pg->m; in fail_path()
971 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
998 struct multipath *m = pgpath->pg->m; in reinstate_path()
1005 if (!pgpath->pg->ps.type->reinstate_path) { in reinstate_path()
1007 pgpath->pg->ps.type->name); in reinstate_path()
1012 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1021 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1047 struct priority_group *pg; in action_dev() local
1049 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1050 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1062 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1069 pg->bypassed = bypassed; in bypass_pg()
1083 struct priority_group *pg; in switch_pg_num() local
1095 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1096 pg->bypassed = 0; in switch_pg_num()
1102 m->next_pg = pg; in switch_pg_num()
1116 struct priority_group *pg; in bypass_pg_num() local
1126 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1131 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1158 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1159 struct multipath *m = pg->m; in pg_init_done()
1184 bypass_pg(m, pg, 1); in pg_init_done()
1212 pg->bypassed = 0; in pg_init_done()
1319 ps = &pgpath->pg->ps; in multipath_end_io()
1385 struct priority_group *pg; in multipath_status() local
1428 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1429 if (pg->bypassed) in multipath_status()
1431 else if (pg == m->current_pg) in multipath_status()
1438 if (pg->ps.type->status) in multipath_status()
1439 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1445 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1446 pg->ps.type->info_args); in multipath_status()
1448 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1452 if (pg->ps.type->status) in multipath_status()
1453 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1461 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1462 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1464 if (pg->ps.type->status) in multipath_status()
1465 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1471 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1472 pg->ps.type->table_args); in multipath_status()
1474 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1476 if (pg->ps.type->status) in multipath_status()
1477 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1612 struct priority_group *pg; in multipath_iterate_devices() local
1616 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
1617 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
1647 struct priority_group *pg; in multipath_busy() local
1661 pg = m->next_pg; in multipath_busy()
1663 pg = m->current_pg; in multipath_busy()
1679 list_for_each_entry(pgpath, &pg->pgpaths, list) in multipath_busy()