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()
170 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
173 struct path_selector *ps = &pg->ps; in free_priority_group()
180 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
181 kfree(pg); in free_priority_group()
212 struct priority_group *pg, *tmp; in free_multipath() local
214 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
215 list_del(&pg->list); in free_multipath()
216 free_priority_group(pg, m->ti); in free_multipath()
282 m->current_pg = pgpath->pg; in __switch_pg()
296 static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg, in __choose_path_in_pg() argument
301 path = pg->ps.type->select_path(&pg->ps, &m->repeat_count, nr_bytes); in __choose_path_in_pg()
307 if (m->current_pg != pg) in __choose_path_in_pg()
315 struct priority_group *pg; in __choose_pgpath() local
325 pg = m->next_pg; in __choose_pgpath()
327 if (!__choose_path_in_pg(m, pg, nr_bytes)) in __choose_pgpath()
342 list_for_each_entry(pg, &m->priority_groups, list) { in __choose_pgpath()
343 if (pg->bypassed == bypassed) in __choose_pgpath()
345 if (!__choose_path_in_pg(m, pg, nr_bytes)) { in __choose_pgpath()
439 if (pgpath->pg->ps.type->start_io) in __multipath_map()
440 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map()
514 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
537 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
544 pg->ps.type = pst; in parse_path_selector()
648 struct priority_group *pg; in parse_priority_group() local
657 pg = alloc_priority_group(); in parse_priority_group()
658 if (!pg) { in parse_priority_group()
662 pg->m = m; in parse_priority_group()
664 r = parse_path_selector(as, pg, ti); in parse_priority_group()
671 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
680 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
693 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
699 pgpath->pg = pg; in parse_priority_group()
700 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
704 return pg; in parse_priority_group()
707 free_priority_group(pg, ti); in parse_priority_group()
858 struct priority_group *pg; in multipath_ctr() local
860 pg = parse_priority_group(&as, m); in multipath_ctr()
861 if (IS_ERR(pg)) { in multipath_ctr()
862 r = PTR_ERR(pg); in multipath_ctr()
866 m->nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
867 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
869 pg->pg_num = pg_count; in multipath_ctr()
871 m->next_pg = pg; in multipath_ctr()
947 struct multipath *m = pgpath->pg->m; in fail_path()
956 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
983 struct multipath *m = pgpath->pg->m; in reinstate_path()
990 if (!pgpath->pg->ps.type->reinstate_path) { in reinstate_path()
992 pgpath->pg->ps.type->name); in reinstate_path()
997 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1006 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1032 struct priority_group *pg; in action_dev() local
1034 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1035 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1047 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1054 pg->bypassed = bypassed; in bypass_pg()
1068 struct priority_group *pg; in switch_pg_num() local
1080 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1081 pg->bypassed = 0; in switch_pg_num()
1087 m->next_pg = pg; in switch_pg_num()
1101 struct priority_group *pg; in bypass_pg_num() local
1111 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1116 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1143 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1144 struct multipath *m = pg->m; in pg_init_done()
1169 bypass_pg(m, pg, 1); in pg_init_done()
1197 pg->bypassed = 0; in pg_init_done()
1304 ps = &pgpath->pg->ps; in multipath_end_io()
1370 struct priority_group *pg; in multipath_status() local
1413 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1414 if (pg->bypassed) in multipath_status()
1416 else if (pg == m->current_pg) in multipath_status()
1423 if (pg->ps.type->status) in multipath_status()
1424 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1430 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1431 pg->ps.type->info_args); in multipath_status()
1433 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1437 if (pg->ps.type->status) in multipath_status()
1438 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1446 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1447 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1449 if (pg->ps.type->status) in multipath_status()
1450 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1456 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1457 pg->ps.type->table_args); in multipath_status()
1459 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1461 if (pg->ps.type->status) in multipath_status()
1462 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1591 struct priority_group *pg; in multipath_iterate_devices() local
1595 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
1596 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
1626 struct priority_group *pg; in multipath_busy() local
1640 pg = m->next_pg; in multipath_busy()
1642 pg = m->current_pg; in multipath_busy()
1658 list_for_each_entry(pgpath, &pg->pgpaths, list) in multipath_busy()