Lines Matching refs:pg
44 struct priority_group *pg; /* Owning PG */ member
175 struct priority_group *pg; in alloc_priority_group() local
177 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
179 if (pg) in alloc_priority_group()
180 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
182 return pg; in alloc_priority_group()
196 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
199 struct path_selector *ps = &pg->ps; in free_priority_group()
206 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
207 kfree(pg); in free_priority_group()
263 struct priority_group *pg, *tmp; in free_multipath() local
265 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
266 list_del(&pg->list); in free_multipath()
267 free_priority_group(pg, m->ti); in free_multipath()
359 static void __switch_pg(struct multipath *m, struct priority_group *pg) in __switch_pg() argument
363 m->current_pg = pg; in __switch_pg()
378 struct priority_group *pg, in choose_path_in_pg() argument
385 path = pg->ps.type->select_path(&pg->ps, nr_bytes); in choose_path_in_pg()
391 if (unlikely(READ_ONCE(m->current_pg) != pg)) { in choose_path_in_pg()
395 __switch_pg(m, pg); in choose_path_in_pg()
405 struct priority_group *pg; in choose_pgpath() local
419 pg = m->next_pg; in choose_pgpath()
420 if (!pg) { in choose_pgpath()
426 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
433 pg = READ_ONCE(m->current_pg); in choose_pgpath()
434 if (pg) { in choose_pgpath()
435 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
447 list_for_each_entry(pg, &m->priority_groups, list) { in choose_pgpath()
448 if (pg->bypassed == !!bypassed) in choose_pgpath()
450 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
563 if (pgpath->pg->ps.type->start_io) in multipath_clone_and_map()
564 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in multipath_clone_and_map()
581 if (pgpath && pgpath->pg->ps.type->end_io) in multipath_release_clone()
582 pgpath->pg->ps.type->end_io(&pgpath->pg->ps, in multipath_release_clone()
657 if (dm_ps_use_hr_timer(pgpath->pg->ps.type)) in __multipath_map_bio()
664 if (pgpath->pg->ps.type->start_io) in __multipath_map_bio()
665 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map_bio()
846 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
869 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
876 pg->ps.type = pst; in parse_path_selector()
995 struct priority_group *pg; in parse_priority_group() local
1004 pg = alloc_priority_group(); in parse_priority_group()
1005 if (!pg) { in parse_priority_group()
1009 pg->m = m; in parse_priority_group()
1011 r = parse_path_selector(as, pg, ti); in parse_priority_group()
1018 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
1027 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
1040 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
1046 pgpath->pg = pg; in parse_priority_group()
1047 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
1051 return pg; in parse_priority_group()
1054 free_priority_group(pg, ti); in parse_priority_group()
1234 struct priority_group *pg; in multipath_ctr() local
1237 pg = parse_priority_group(&as, m); in multipath_ctr()
1238 if (IS_ERR(pg)) { in multipath_ctr()
1239 r = PTR_ERR(pg); in multipath_ctr()
1243 nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
1246 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
1248 pg->pg_num = pg_count; in multipath_ctr()
1250 m->next_pg = pg; in multipath_ctr()
1335 struct multipath *m = pgpath->pg->m; in fail_path()
1346 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1375 struct multipath *m = pgpath->pg->m; in reinstate_path()
1387 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1397 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1428 struct priority_group *pg; in action_dev() local
1430 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1431 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1443 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1450 pg->bypassed = bypassed; in bypass_pg()
1464 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()
1483 m->next_pg = pg; in switch_pg_num()
1497 struct priority_group *pg; in bypass_pg_num() local
1507 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1512 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1540 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1541 struct multipath *m = pg->m; in pg_init_done()
1566 bypass_pg(m, pg, true); in pg_init_done()
1596 pg->bypassed = false; in pg_init_done()
1681 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io()
1725 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io_bio()
1805 struct priority_group *pg; in multipath_status() local
1861 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1862 if (pg->bypassed) in multipath_status()
1864 else if (pg == m->current_pg) in multipath_status()
1871 if (pg->ps.type->status) in multipath_status()
1872 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1878 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1879 pg->ps.type->info_args); in multipath_status()
1881 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1885 if (pg->ps.type->status) in multipath_status()
1886 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1894 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1895 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1897 if (pg->ps.type->status) in multipath_status()
1898 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1904 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1905 pg->ps.type->table_args); in multipath_status()
1907 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1909 if (pg->ps.type->status) in multipath_status()
1910 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1924 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1925 if (pg->bypassed) in multipath_status()
1927 else if (pg == m->current_pg) in multipath_status()
1932 DMEMIT(",nr_pgpaths_%d=%u", pg_counter, pg->nr_pgpaths); in multipath_status()
1933 DMEMIT(",path_selector_name_%d=%s", pg_counter, pg->ps.type->name); in multipath_status()
1936 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1941 if (pg->ps.type->status) { in multipath_status()
1944 sz += pg->ps.type->status(&pg->ps, &p->path, in multipath_status()
2082 struct priority_group *pg; in multipath_iterate_devices() local
2086 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
2087 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
2117 struct priority_group *pg, *next_pg; in multipath_busy() local
2137 pg = READ_ONCE(m->current_pg); in multipath_busy()
2140 pg = next_pg; in multipath_busy()
2142 if (!pg) { in multipath_busy()
2158 list_for_each_entry(pgpath, &pg->pgpaths, list) { in multipath_busy()