• Home
  • Raw
  • Download

Lines Matching full:pg

41 	struct priority_group *pg;	/* Owning PG */  member
63 unsigned nr_pgpaths; /* Number of paths in PG */
66 bool bypassed:1; /* Temporarily bypass this PG? */
78 struct priority_group *next_pg; /* Switch to this PG if set */
168 struct priority_group *pg; in alloc_priority_group() local
170 pg = kzalloc(sizeof(*pg), GFP_KERNEL); in alloc_priority_group()
172 if (pg) in alloc_priority_group()
173 INIT_LIST_HEAD(&pg->pgpaths); in alloc_priority_group()
175 return pg; in alloc_priority_group()
189 static void free_priority_group(struct priority_group *pg, in free_priority_group() argument
192 struct path_selector *ps = &pg->ps; in free_priority_group()
199 free_pgpaths(&pg->pgpaths, ti); in free_priority_group()
200 kfree(pg); in free_priority_group()
256 struct priority_group *pg, *tmp; in free_multipath() local
258 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) { in free_multipath()
259 list_del(&pg->list); in free_multipath()
260 free_priority_group(pg, m->ti); in free_multipath()
350 static void __switch_pg(struct multipath *m, struct priority_group *pg) in __switch_pg() argument
354 m->current_pg = pg; in __switch_pg()
356 /* Must we initialise the PG first, and queue I/O till it's ready? */ in __switch_pg()
369 struct priority_group *pg, in choose_path_in_pg() argument
376 path = pg->ps.type->select_path(&pg->ps, nr_bytes); in choose_path_in_pg()
382 if (unlikely(READ_ONCE(m->current_pg) != pg)) { in choose_path_in_pg()
383 /* Only update current_pgpath if pg changed */ in choose_path_in_pg()
386 __switch_pg(m, pg); in choose_path_in_pg()
396 struct priority_group *pg; in choose_pgpath() local
407 /* Were we instructed to switch PG? */ in choose_pgpath()
410 pg = m->next_pg; in choose_pgpath()
411 if (!pg) { in choose_pgpath()
417 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
422 /* Don't change PG until it has no remaining paths */ in choose_pgpath()
424 pg = READ_ONCE(m->current_pg); in choose_pgpath()
425 if (pg) { in choose_pgpath()
426 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
438 list_for_each_entry(pg, &m->priority_groups, list) { in choose_pgpath()
439 if (pg->bypassed == !!bypassed) in choose_pgpath()
441 pgpath = choose_path_in_pg(m, pg, nr_bytes); in choose_pgpath()
557 if (pgpath->pg->ps.type->start_io) in multipath_clone_and_map()
558 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in multipath_clone_and_map()
575 if (pgpath && pgpath->pg->ps.type->end_io) in multipath_release_clone()
576 pgpath->pg->ps.type->end_io(&pgpath->pg->ps, in multipath_release_clone()
655 if (pgpath->pg->ps.type->start_io) in __multipath_map_bio()
656 pgpath->pg->ps.type->start_io(&pgpath->pg->ps, in __multipath_map_bio()
814 * Includes path failure and PG bypass.
834 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg, in parse_path_selector() argument
857 r = pst->create(&pg->ps, ps_argc, as->argv); in parse_path_selector()
864 pg->ps.type = pst; in parse_path_selector()
986 struct priority_group *pg; in parse_priority_group() local
995 pg = alloc_priority_group(); in parse_priority_group()
996 if (!pg) { in parse_priority_group()
1000 pg->m = m; in parse_priority_group()
1002 r = parse_path_selector(as, pg, ti); in parse_priority_group()
1009 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error); in parse_priority_group()
1018 for (i = 0; i < pg->nr_pgpaths; i++) { in parse_priority_group()
1031 pgpath = parse_path(&path_args, &pg->ps, ti); in parse_priority_group()
1037 pgpath->pg = pg; in parse_priority_group()
1038 list_add_tail(&pgpath->list, &pg->pgpaths); in parse_priority_group()
1042 return pg; in parse_priority_group()
1045 free_priority_group(pg, ti); in parse_priority_group()
1225 struct priority_group *pg; in multipath_ctr() local
1228 pg = parse_priority_group(&as, m); in multipath_ctr()
1229 if (IS_ERR(pg)) { in multipath_ctr()
1230 r = PTR_ERR(pg); in multipath_ctr()
1234 nr_valid_paths += pg->nr_pgpaths; in multipath_ctr()
1237 list_add_tail(&pg->list, &m->priority_groups); in multipath_ctr()
1239 pg->pg_num = pg_count; in multipath_ctr()
1241 m->next_pg = pg; in multipath_ctr()
1327 struct multipath *m = pgpath->pg->m; in fail_path()
1338 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path); in fail_path()
1367 struct multipath *m = pgpath->pg->m; in reinstate_path()
1379 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path); in reinstate_path()
1389 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) { in reinstate_path()
1420 struct priority_group *pg; in action_dev() local
1422 list_for_each_entry(pg, &m->priority_groups, list) { in action_dev()
1423 list_for_each_entry(pgpath, &pg->pgpaths, list) { in action_dev()
1433 * Temporarily try to avoid having to use the specified PG
1435 static void bypass_pg(struct multipath *m, struct priority_group *pg, in bypass_pg() argument
1442 pg->bypassed = bypassed; in bypass_pg()
1452 * Switch to using the specified PG from the next I/O that gets mapped
1456 struct priority_group *pg; in switch_pg_num() local
1463 DMWARN("invalid PG number supplied to switch_pg_num"); in switch_pg_num()
1468 list_for_each_entry(pg, &m->priority_groups, list) { in switch_pg_num()
1469 pg->bypassed = false; in switch_pg_num()
1475 m->next_pg = pg; in switch_pg_num()
1484 * Set/clear bypassed status of a PG.
1489 struct priority_group *pg; in bypass_pg_num() local
1495 DMWARN("invalid PG number supplied to bypass_pg"); in bypass_pg_num()
1499 list_for_each_entry(pg, &m->priority_groups, list) { in bypass_pg_num()
1504 bypass_pg(m, pg, bypassed); in bypass_pg_num()
1532 struct priority_group *pg = pgpath->pg; in pg_init_done() local
1533 struct multipath *m = pg->m; in pg_init_done()
1556 * controller so try the other pg. in pg_init_done()
1558 bypass_pg(m, pg, true); in pg_init_done()
1588 pg->bypassed = false; in pg_init_done()
1673 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io()
1717 struct path_selector *ps = &pgpath->pg->ps; in multipath_end_io_bio()
1796 struct priority_group *pg; in multipath_status() local
1852 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1853 if (pg->bypassed) in multipath_status()
1855 else if (pg == m->current_pg) in multipath_status()
1862 if (pg->ps.type->status) in multipath_status()
1863 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1869 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1870 pg->ps.type->info_args); in multipath_status()
1872 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1876 if (pg->ps.type->status) in multipath_status()
1877 sz += pg->ps.type->status(&pg->ps, in multipath_status()
1885 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_status()
1886 DMEMIT("%s ", pg->ps.type->name); in multipath_status()
1888 if (pg->ps.type->status) in multipath_status()
1889 sz += pg->ps.type->status(&pg->ps, NULL, type, in multipath_status()
1895 DMEMIT("%u %u ", pg->nr_pgpaths, in multipath_status()
1896 pg->ps.type->table_args); in multipath_status()
1898 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_status()
1900 if (pg->ps.type->status) in multipath_status()
1901 sz += pg->ps.type->status(&pg->ps, in multipath_status()
2035 struct priority_group *pg; in multipath_iterate_devices() local
2039 list_for_each_entry(pg, &m->priority_groups, list) { in multipath_iterate_devices()
2040 list_for_each_entry(p, &pg->pgpaths, list) { in multipath_iterate_devices()
2070 struct priority_group *pg, *next_pg; in multipath_busy() local
2089 pg = READ_ONCE(m->current_pg); in multipath_busy()
2092 pg = next_pg; in multipath_busy()
2094 if (!pg) { in multipath_busy()
2096 * We don't know which pg will be used at next mapping time. in multipath_busy()
2107 * will be able to select it. So we consider such a pg as not busy. in multipath_busy()
2110 list_for_each_entry(pgpath, &pg->pgpaths, list) { in multipath_busy()
2122 * No active path in this pg, so this pg won't be used and in multipath_busy()