Lines Matching refs:pg

44 	struct priority_group *pg;	/* Owning PG */  member
180 struct priority_group *pg; in alloc_priority_group() local
182 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
184 if (pg) in alloc_priority_group()
185 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
187 return pg; in alloc_priority_group()
201 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
204 struct path_selector *ps = &pg->ps; in free_priority_group()
211 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
212 kfree(pg); in free_priority_group()
269 struct priority_group *pg, *tmp; in free_multipath() local
271 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
272 list_del(&pg->list); in free_multipath()
273 free_priority_group(pg, m->ti); in free_multipath()
365 static void __switch_pg(struct multipath *m, struct priority_group *pg) in __switch_pg() argument
369 m->current_pg = pg; in __switch_pg()
384 struct priority_group *pg, in choose_path_in_pg() argument
391 path = pg->ps.type->select_path(&pg->ps, nr_bytes); in choose_path_in_pg()
397 if (unlikely(READ_ONCE(m->current_pg) != pg)) { in choose_path_in_pg()
401 __switch_pg(m, pg); in choose_path_in_pg()
411 struct priority_group *pg; in choose_pgpath() local
423 pg = READ_ONCE(m->current_pg); in choose_pgpath()
424 if (pg) { in choose_pgpath()
425 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
433 pg = m->next_pg; in choose_pgpath()
434 if (!pg) { in choose_pgpath()
440 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
452 list_for_each_entry(pg, &m->priority_groups, list) { in choose_pgpath()
453 if (pg->bypassed == !!bypassed) in choose_pgpath()
455 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
568 if (pgpath->pg->ps.type->start_io) in multipath_clone_and_map()
569 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in multipath_clone_and_map()
586 if (pgpath && pgpath->pg->ps.type->end_io) in multipath_release_clone()
587 pgpath->pg->ps.type->end_io(&pgpath->pg->ps, in multipath_release_clone()
661 if (dm_ps_use_hr_timer(pgpath->pg->ps.type)) in __multipath_map_bio()
668 if (pgpath->pg->ps.type->start_io) in __multipath_map_bio()
669 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map_bio()
848 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
871 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
878 pg->ps.type = pst; in parse_path_selector()
997 struct priority_group *pg; in parse_priority_group() local
1006 pg = alloc_priority_group(); in parse_priority_group()
1007 if (!pg) { in parse_priority_group()
1011 pg->m = m; in parse_priority_group()
1013 r = parse_path_selector(as, pg, ti); in parse_priority_group()
1020 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
1029 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
1042 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
1048 pgpath->pg = pg; in parse_priority_group()
1049 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
1053 return pg; in parse_priority_group()
1056 free_priority_group(pg, ti); in parse_priority_group()
1235 struct priority_group *pg; in multipath_ctr() local
1238 pg = parse_priority_group(&as, m); in multipath_ctr()
1239 if (IS_ERR(pg)) { in multipath_ctr()
1240 r = PTR_ERR(pg); in multipath_ctr()
1244 nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
1247 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
1249 pg->pg_num = pg_count; in multipath_ctr()
1251 m->next_pg = pg; in multipath_ctr()
1334 struct multipath *m = pgpath->pg->m; in fail_path()
1345 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1373 struct multipath *m = pgpath->pg->m; in reinstate_path()
1385 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1395 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1425 struct priority_group *pg; in action_dev() local
1427 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1428 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1440 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1447 pg->bypassed = bypassed; in bypass_pg()
1465 struct priority_group *pg; in switch_pg_num() local
1476 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1477 pg->bypassed = false; in switch_pg_num()
1487 m->next_pg = pg; in switch_pg_num()
1501 struct priority_group *pg; in bypass_pg_num() local
1511 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1516 bypass_pg(m, pg, bypassed, true); in bypass_pg_num()
1544 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1545 struct multipath *m = pg->m; in pg_init_done()
1570 bypass_pg(m, pg, true, false); in pg_init_done()
1600 pg->bypassed = false; in pg_init_done()
1685 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io()
1729 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io_bio()
1811 struct priority_group *pg; in multipath_status() local
1867 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1868 if (pg->bypassed) in multipath_status()
1870 else if (pg == m->current_pg) in multipath_status()
1877 if (pg->ps.type->status) in multipath_status()
1878 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1884 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1885 pg->ps.type->info_args); in multipath_status()
1887 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1891 if (pg->ps.type->status) in multipath_status()
1892 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1900 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1901 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1903 if (pg->ps.type->status) in multipath_status()
1904 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1910 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1911 pg->ps.type->table_args); in multipath_status()
1913 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1915 if (pg->ps.type->status) in multipath_status()
1916 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1930 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1931 if (pg->bypassed) in multipath_status()
1933 else if (pg == m->current_pg) in multipath_status()
1938 DMEMIT(",nr_pgpaths_%d=%u", pg_counter, pg->nr_pgpaths); in multipath_status()
1939 DMEMIT(",path_selector_name_%d=%s", pg_counter, pg->ps.type->name); in multipath_status()
1942 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1947 if (pg->ps.type->status) { in multipath_status()
1950 sz += pg->ps.type->status(&pg->ps, &p->path, in multipath_status()
2087 struct priority_group *pg = NULL; in probe_active_paths() local
2107 pg = m->last_probed_pg = m->current_pg; in probe_active_paths()
2110 list_for_each_entry(pgpath, &pg->pgpaths, list) { in probe_active_paths()
2111 if (pg != READ_ONCE(m->current_pg) || in probe_active_paths()
2133 if (pg) in probe_active_paths()
2203 struct priority_group *pg; in multipath_iterate_devices() local
2207 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
2208 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
2238 struct priority_group *pg, *next_pg; in multipath_busy() local
2258 pg = READ_ONCE(m->current_pg); in multipath_busy()
2261 pg = next_pg; in multipath_busy()
2263 if (!pg) { in multipath_busy()
2279 list_for_each_entry(pgpath, &pg->pgpaths, list) { in multipath_busy()