Lines Matching refs:pg
33 struct priority_group *pg; /* Owning PG */ member
152 struct priority_group *pg; in alloc_priority_group() local
154 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
156 if (pg) in alloc_priority_group()
157 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
159 return pg; in alloc_priority_group()
176 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
179 struct path_selector *ps = &pg->ps; in free_priority_group()
186 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
187 kfree(pg); in free_priority_group()
219 struct priority_group *pg, *tmp; in free_multipath() local
221 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
222 list_del(&pg->list); in free_multipath()
223 free_priority_group(pg, m->ti); in free_multipath()
280 m->current_pg = pgpath->pg; in __switch_pg()
294 static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg, in __choose_path_in_pg() argument
299 path = pg->ps.type->select_path(&pg->ps, &m->repeat_count, nr_bytes); in __choose_path_in_pg()
305 if (m->current_pg != pg) in __choose_path_in_pg()
313 struct priority_group *pg; in __choose_pgpath() local
321 pg = m->next_pg; in __choose_pgpath()
323 if (!__choose_path_in_pg(m, pg, nr_bytes)) in __choose_pgpath()
338 list_for_each_entry(pg, &m->priority_groups, list) { in __choose_pgpath()
339 if (pg->bypassed == bypassed) in __choose_pgpath()
341 if (!__choose_path_in_pg(m, pg, nr_bytes)) { in __choose_pgpath()
415 if (r == DM_MAPIO_REMAPPED && pgpath->pg->ps.type->start_io) in map_io()
416 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, &pgpath->path, in map_io()
530 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
553 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
560 pg->ps.type = pst; in parse_path_selector()
670 struct priority_group *pg; in parse_priority_group() local
679 pg = alloc_priority_group(); in parse_priority_group()
680 if (!pg) { in parse_priority_group()
684 pg->m = m; in parse_priority_group()
686 r = parse_path_selector(as, pg, ti); in parse_priority_group()
693 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
702 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
715 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
721 pgpath->pg = pg; in parse_priority_group()
722 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
726 return pg; in parse_priority_group()
729 free_priority_group(pg, ti); in parse_priority_group()
886 struct priority_group *pg; in multipath_ctr() local
888 pg = parse_priority_group(&as, m); in multipath_ctr()
889 if (IS_ERR(pg)) { in multipath_ctr()
890 r = PTR_ERR(pg); in multipath_ctr()
894 m->nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
895 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
897 pg->pg_num = pg_count; in multipath_ctr()
899 m->next_pg = pg; in multipath_ctr()
986 struct multipath *m = pgpath->pg->m; in fail_path()
995 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1022 struct multipath *m = pgpath->pg->m; in reinstate_path()
1029 if (!pgpath->pg->ps.type->reinstate_path) { in reinstate_path()
1031 pgpath->pg->ps.type->name); in reinstate_path()
1036 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1045 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1069 struct priority_group *pg; in action_dev() local
1071 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1072 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1084 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1091 pg->bypassed = bypassed; in bypass_pg()
1105 struct priority_group *pg; in switch_pg_num() local
1117 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1118 pg->bypassed = 0; in switch_pg_num()
1124 m->next_pg = pg; in switch_pg_num()
1138 struct priority_group *pg; in bypass_pg_num() local
1148 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1153 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1180 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1181 struct multipath *m = pg->m; in pg_init_done()
1206 bypass_pg(m, pg, 1); in pg_init_done()
1234 pg->bypassed = 0; in pg_init_done()
1322 ps = &pgpath->pg->ps; in multipath_end_io()
1388 struct priority_group *pg; in multipath_status() local
1431 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1432 if (pg->bypassed) in multipath_status()
1434 else if (pg == m->current_pg) in multipath_status()
1441 if (pg->ps.type->status) in multipath_status()
1442 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1448 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1449 pg->ps.type->info_args); in multipath_status()
1451 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1455 if (pg->ps.type->status) in multipath_status()
1456 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1464 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1465 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1467 if (pg->ps.type->status) in multipath_status()
1468 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1474 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1475 pg->ps.type->table_args); in multipath_status()
1477 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1479 if (pg->ps.type->status) in multipath_status()
1480 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1607 struct priority_group *pg; in multipath_iterate_devices() local
1611 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
1612 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
1642 struct priority_group *pg; in multipath_busy() local
1650 pg = m->next_pg; in multipath_busy()
1652 pg = m->current_pg; in multipath_busy()
1668 list_for_each_entry(pgpath, &pg->pgpaths, list) in multipath_busy()