Lines Matching refs:pg

37 	struct priority_group *pg;	/* Owning PG */  member
147 struct priority_group *pg; in alloc_priority_group() local
149 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
151 if (pg) in alloc_priority_group()
152 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
154 return pg; in alloc_priority_group()
168 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
171 struct path_selector *ps = &pg->ps; in free_priority_group()
178 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
179 kfree(pg); in free_priority_group()
233 struct priority_group *pg, *tmp; in free_multipath() local
235 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
236 list_del(&pg->list); in free_multipath()
237 free_priority_group(pg, m->ti); in free_multipath()
327 static void __switch_pg(struct multipath *m, struct priority_group *pg) in __switch_pg() argument
329 m->current_pg = pg; in __switch_pg()
344 struct priority_group *pg, in choose_path_in_pg() argument
351 path = pg->ps.type->select_path(&pg->ps, nr_bytes); in choose_path_in_pg()
357 if (unlikely(READ_ONCE(m->current_pg) != pg)) { in choose_path_in_pg()
361 __switch_pg(m, pg); in choose_path_in_pg()
371 struct priority_group *pg; in choose_pgpath() local
383 pg = m->next_pg; in choose_pgpath()
384 if (!pg) { in choose_pgpath()
390 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
397 pg = READ_ONCE(m->current_pg); in choose_pgpath()
398 if (pg) { in choose_pgpath()
399 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
411 list_for_each_entry(pg, &m->priority_groups, list) { in choose_pgpath()
412 if (pg->bypassed == !!bypassed) in choose_pgpath()
414 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
540 if (pgpath->pg->ps.type->start_io) in multipath_clone_and_map()
541 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in multipath_clone_and_map()
558 if (pgpath && pgpath->pg->ps.type->end_io) in multipath_release_clone()
559 pgpath->pg->ps.type->end_io(&pgpath->pg->ps, in multipath_release_clone()
658 if (pgpath->pg->ps.type->start_io) in __multipath_map_bio()
659 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map_bio()
777 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
800 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
807 pg->ps.type = pst; in parse_path_selector()
929 struct priority_group *pg; in parse_priority_group() local
938 pg = alloc_priority_group(); in parse_priority_group()
939 if (!pg) { in parse_priority_group()
943 pg->m = m; in parse_priority_group()
945 r = parse_path_selector(as, pg, ti); in parse_priority_group()
952 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
961 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
974 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
980 pgpath->pg = pg; in parse_priority_group()
981 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
985 return pg; in parse_priority_group()
988 free_priority_group(pg, ti); in parse_priority_group()
1167 struct priority_group *pg; in multipath_ctr() local
1170 pg = parse_priority_group(&as, m); in multipath_ctr()
1171 if (IS_ERR(pg)) { in multipath_ctr()
1172 r = PTR_ERR(pg); in multipath_ctr()
1176 nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
1179 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
1181 pg->pg_num = pg_count; in multipath_ctr()
1183 m->next_pg = pg; in multipath_ctr()
1256 struct multipath *m = pgpath->pg->m; in fail_path()
1265 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1292 struct multipath *m = pgpath->pg->m; in reinstate_path()
1302 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1312 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1340 struct priority_group *pg; in action_dev() local
1342 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1343 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1355 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1362 pg->bypassed = bypassed; in bypass_pg()
1376 struct priority_group *pg; in switch_pg_num() local
1388 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1389 pg->bypassed = false; in switch_pg_num()
1395 m->next_pg = pg; in switch_pg_num()
1409 struct priority_group *pg; in bypass_pg_num() local
1419 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1424 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1452 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1453 struct multipath *m = pg->m; in pg_init_done()
1478 bypass_pg(m, pg, true); in pg_init_done()
1508 pg->bypassed = false; in pg_init_done()
1593 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io()
1637 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io_bio()
1704 struct priority_group *pg; in multipath_status() local
1760 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1761 if (pg->bypassed) in multipath_status()
1763 else if (pg == m->current_pg) in multipath_status()
1770 if (pg->ps.type->status) in multipath_status()
1771 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1777 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1778 pg->ps.type->info_args); in multipath_status()
1780 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1784 if (pg->ps.type->status) in multipath_status()
1785 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1793 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1794 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1796 if (pg->ps.type->status) in multipath_status()
1797 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1803 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1804 pg->ps.type->table_args); in multipath_status()
1806 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1808 if (pg->ps.type->status) in multipath_status()
1809 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1934 struct priority_group *pg; in multipath_iterate_devices() local
1938 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
1939 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
1969 struct priority_group *pg, *next_pg; in multipath_busy() local
1981 pg = READ_ONCE(m->current_pg); in multipath_busy()
1984 pg = next_pg; in multipath_busy()
1986 if (!pg) { in multipath_busy()
2002 list_for_each_entry(pgpath, &pg->pgpaths, list) { in multipath_busy()