Lines Matching refs:pg
41 struct priority_group *pg; /* Owning PG */
168 struct priority_group *pg;
170 pg = kzalloc(sizeof(*pg), GFP_KERNEL);
172 if (pg)
173 INIT_LIST_HEAD(&pg->pgpaths);
175 return pg;
189 static void free_priority_group(struct priority_group *pg,
192 struct path_selector *ps = &pg->ps;
199 free_pgpaths(&pg->pgpaths, ti);
200 kfree(pg);
256 struct priority_group *pg, *tmp;
258 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) {
259 list_del(&pg->list);
260 free_priority_group(pg, m->ti);
350 static void __switch_pg(struct multipath *m, struct priority_group *pg)
354 m->current_pg = pg;
369 struct priority_group *pg,
376 path = pg->ps.type->select_path(&pg->ps, nr_bytes);
382 if (unlikely(READ_ONCE(m->current_pg) != pg)) {
383 /* Only update current_pgpath if pg changed */
386 __switch_pg(m, pg);
396 struct priority_group *pg;
410 pg = m->next_pg;
411 if (!pg) {
417 pgpath = choose_path_in_pg(m, pg, nr_bytes);
424 pg = READ_ONCE(m->current_pg);
425 if (pg) {
426 pgpath = choose_path_in_pg(m, pg, nr_bytes);
438 list_for_each_entry(pg, &m->priority_groups, list) {
439 if (pg->bypassed == !!bypassed)
441 pgpath = choose_path_in_pg(m, pg, nr_bytes);
557 if (pgpath->pg->ps.type->start_io)
558 pgpath->pg->ps.type->start_io(&pgpath->pg->ps,
575 if (pgpath && pgpath->pg->ps.type->end_io)
576 pgpath->pg->ps.type->end_io(&pgpath->pg->ps,
655 if (pgpath->pg->ps.type->start_io)
656 pgpath->pg->ps.type->start_io(&pgpath->pg->ps,
834 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg,
857 r = pst->create(&pg->ps, ps_argc, as->argv);
864 pg->ps.type = pst;
986 struct priority_group *pg;
995 pg = alloc_priority_group();
996 if (!pg) {
1000 pg->m = m;
1002 r = parse_path_selector(as, pg, ti);
1009 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error);
1018 for (i = 0; i < pg->nr_pgpaths; i++) {
1031 pgpath = parse_path(&path_args, &pg->ps, ti);
1037 pgpath->pg = pg;
1038 list_add_tail(&pgpath->list, &pg->pgpaths);
1042 return pg;
1045 free_priority_group(pg, ti);
1225 struct priority_group *pg;
1228 pg = parse_priority_group(&as, m);
1229 if (IS_ERR(pg)) {
1230 r = PTR_ERR(pg);
1234 nr_valid_paths += pg->nr_pgpaths;
1237 list_add_tail(&pg->list, &m->priority_groups);
1239 pg->pg_num = pg_count;
1241 m->next_pg = pg;
1327 struct multipath *m = pgpath->pg->m;
1338 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
1367 struct multipath *m = pgpath->pg->m;
1379 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path);
1389 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) {
1420 struct priority_group *pg;
1422 list_for_each_entry(pg, &m->priority_groups, list) {
1423 list_for_each_entry(pgpath, &pg->pgpaths, list) {
1435 static void bypass_pg(struct multipath *m, struct priority_group *pg,
1442 pg->bypassed = bypassed;
1456 struct priority_group *pg;
1468 list_for_each_entry(pg, &m->priority_groups, list) {
1469 pg->bypassed = false;
1475 m->next_pg = pg;
1489 struct priority_group *pg;
1499 list_for_each_entry(pg, &m->priority_groups, list) {
1504 bypass_pg(m, pg, bypassed);
1532 struct priority_group *pg = pgpath->pg;
1533 struct multipath *m = pg->m;
1556 * controller so try the other pg.
1558 bypass_pg(m, pg, true);
1588 pg->bypassed = false;
1673 struct path_selector *ps = &pgpath->pg->ps;
1717 struct path_selector *ps = &pgpath->pg->ps;
1796 struct priority_group *pg;
1852 list_for_each_entry(pg, &m->priority_groups, list) {
1853 if (pg->bypassed)
1855 else if (pg == m->current_pg)
1862 if (pg->ps.type->status)
1863 sz += pg->ps.type->status(&pg->ps, NULL, type,
1869 DMEMIT("%u %u ", pg->nr_pgpaths,
1870 pg->ps.type->info_args);
1872 list_for_each_entry(p, &pg->pgpaths, list) {
1876 if (pg->ps.type->status)
1877 sz += pg->ps.type->status(&pg->ps,
1885 list_for_each_entry(pg, &m->priority_groups, list) {
1886 DMEMIT("%s ", pg->ps.type->name);
1888 if (pg->ps.type->status)
1889 sz += pg->ps.type->status(&pg->ps, NULL, type,
1895 DMEMIT("%u %u ", pg->nr_pgpaths,
1896 pg->ps.type->table_args);
1898 list_for_each_entry(p, &pg->pgpaths, list) {
1900 if (pg->ps.type->status)
1901 sz += pg->ps.type->status(&pg->ps,
2035 struct priority_group *pg;
2039 list_for_each_entry(pg, &m->priority_groups, list) {
2040 list_for_each_entry(p, &pg->pgpaths, list) {
2070 struct priority_group *pg, *next_pg;
2089 pg = READ_ONCE(m->current_pg);
2092 pg = next_pg;
2094 if (!pg) {
2096 * We don't know which pg will be used at next mapping time.
2107 * will be able to select it. So we consider such a pg as not busy.
2110 list_for_each_entry(pgpath, &pg->pgpaths, list) {
2122 * No active path in this pg, so this pg won't be used and