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()
240 struct priority_group *pg, *tmp; in free_multipath() local
242 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
243 list_del(&pg->list); in free_multipath()
244 free_priority_group(pg, m->ti); in free_multipath()
334 static void __switch_pg(struct multipath *m, struct priority_group *pg) in __switch_pg() argument
336 m->current_pg = pg; in __switch_pg()
351 struct priority_group *pg, in choose_path_in_pg() argument
358 path = pg->ps.type->select_path(&pg->ps, nr_bytes); in choose_path_in_pg()
364 if (unlikely(READ_ONCE(m->current_pg) != pg)) { in choose_path_in_pg()
368 __switch_pg(m, pg); in choose_path_in_pg()
378 struct priority_group *pg; in choose_pgpath() local
390 pg = m->next_pg; in choose_pgpath()
391 if (!pg) { in choose_pgpath()
397 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
404 pg = READ_ONCE(m->current_pg); in choose_pgpath()
405 if (pg) { in choose_pgpath()
406 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
418 list_for_each_entry(pg, &m->priority_groups, list) { in choose_pgpath()
419 if (pg->bypassed == !!bypassed) in choose_pgpath()
421 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
550 if (pgpath->pg->ps.type->start_io) in multipath_clone_and_map()
551 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in multipath_clone_and_map()
653 if (pgpath->pg->ps.type->start_io) in __multipath_map_bio()
654 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map_bio()
772 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
795 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
802 pg->ps.type = pst; in parse_path_selector()
924 struct priority_group *pg; in parse_priority_group() local
933 pg = alloc_priority_group(); in parse_priority_group()
934 if (!pg) { in parse_priority_group()
938 pg->m = m; in parse_priority_group()
940 r = parse_path_selector(as, pg, ti); in parse_priority_group()
947 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
956 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
969 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
975 pgpath->pg = pg; in parse_priority_group()
976 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
980 return pg; in parse_priority_group()
983 free_priority_group(pg, ti); in parse_priority_group()
1163 struct priority_group *pg; in multipath_ctr() local
1166 pg = parse_priority_group(&as, m); in multipath_ctr()
1167 if (IS_ERR(pg)) { in multipath_ctr()
1168 r = PTR_ERR(pg); in multipath_ctr()
1172 nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
1175 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
1177 pg->pg_num = pg_count; in multipath_ctr()
1179 m->next_pg = pg; in multipath_ctr()
1250 struct multipath *m = pgpath->pg->m; in fail_path()
1259 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1286 struct multipath *m = pgpath->pg->m; in reinstate_path()
1296 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1306 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1334 struct priority_group *pg; in action_dev() local
1336 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1337 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1349 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1356 pg->bypassed = bypassed; in bypass_pg()
1370 struct priority_group *pg; in switch_pg_num() local
1382 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1383 pg->bypassed = false; in switch_pg_num()
1389 m->next_pg = pg; in switch_pg_num()
1403 struct priority_group *pg; in bypass_pg_num() local
1413 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1418 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1446 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1447 struct multipath *m = pg->m; in pg_init_done()
1472 bypass_pg(m, pg, true); in pg_init_done()
1502 pg->bypassed = false; in pg_init_done()
1587 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io()
1631 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io_bio()
1698 struct priority_group *pg; in multipath_status() local
1757 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1758 if (pg->bypassed) in multipath_status()
1760 else if (pg == m->current_pg) in multipath_status()
1767 if (pg->ps.type->status) in multipath_status()
1768 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1774 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1775 pg->ps.type->info_args); in multipath_status()
1777 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1781 if (pg->ps.type->status) in multipath_status()
1782 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1790 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1791 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1793 if (pg->ps.type->status) in multipath_status()
1794 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1800 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1801 pg->ps.type->table_args); in multipath_status()
1803 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1805 if (pg->ps.type->status) in multipath_status()
1806 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1931 struct priority_group *pg; in multipath_iterate_devices() local
1935 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
1936 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
1966 struct priority_group *pg, *next_pg; in multipath_busy() local
1978 pg = READ_ONCE(m->current_pg); in multipath_busy()
1981 pg = next_pg; in multipath_busy()
1983 if (!pg) { in multipath_busy()
1999 list_for_each_entry(pgpath, &pg->pgpaths, list) { in multipath_busy()