Lines Matching refs:pg

44 	struct priority_group *pg;	/* Owning PG */
175 struct priority_group *pg;
177 pg = kzalloc(sizeof(*pg), GFP_KERNEL);
179 if (pg)
180 INIT_LIST_HEAD(&pg->pgpaths);
182 return pg;
196 static void free_priority_group(struct priority_group *pg,
199 struct path_selector *ps = &pg->ps;
206 free_pgpaths(&pg->pgpaths, ti);
207 kfree(pg);
263 struct priority_group *pg, *tmp;
265 list_for_each_entry_safe(pg, tmp, &m->priority_groups, list) {
266 list_del(&pg->list);
267 free_priority_group(pg, m->ti);
359 static void __switch_pg(struct multipath *m, struct priority_group *pg)
363 m->current_pg = pg;
378 struct priority_group *pg,
385 path = pg->ps.type->select_path(&pg->ps, nr_bytes);
391 if (unlikely(READ_ONCE(m->current_pg) != pg)) {
392 /* Only update current_pgpath if pg changed */
395 __switch_pg(m, pg);
405 struct priority_group *pg;
419 pg = m->next_pg;
420 if (!pg) {
426 pgpath = choose_path_in_pg(m, pg, nr_bytes);
433 pg = READ_ONCE(m->current_pg);
434 if (pg) {
435 pgpath = choose_path_in_pg(m, pg, nr_bytes);
447 list_for_each_entry(pg, &m->priority_groups, list) {
448 if (pg->bypassed == !!bypassed)
450 pgpath = choose_path_in_pg(m, pg, nr_bytes);
563 if (pgpath->pg->ps.type->start_io)
564 pgpath->pg->ps.type->start_io(&pgpath->pg->ps,
581 if (pgpath && pgpath->pg->ps.type->end_io)
582 pgpath->pg->ps.type->end_io(&pgpath->pg->ps,
657 if (dm_ps_use_hr_timer(pgpath->pg->ps.type))
664 if (pgpath->pg->ps.type->start_io)
665 pgpath->pg->ps.type->start_io(&pgpath->pg->ps,
846 static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg,
869 r = pst->create(&pg->ps, ps_argc, as->argv);
876 pg->ps.type = pst;
915 DMINFO("retaining handler on device %pg", bdev);
995 struct priority_group *pg;
1004 pg = alloc_priority_group();
1005 if (!pg) {
1009 pg->m = m;
1011 r = parse_path_selector(as, pg, ti);
1018 r = dm_read_arg(_args, as, &pg->nr_pgpaths, &ti->error);
1027 for (i = 0; i < pg->nr_pgpaths; i++) {
1040 pgpath = parse_path(&path_args, &pg->ps, ti);
1046 pgpath->pg = pg;
1047 list_add_tail(&pgpath->list, &pg->pgpaths);
1051 return pg;
1054 free_priority_group(pg, ti);
1234 struct priority_group *pg;
1237 pg = parse_priority_group(&as, m);
1238 if (IS_ERR(pg)) {
1239 r = PTR_ERR(pg);
1243 nr_valid_paths += pg->nr_pgpaths;
1246 list_add_tail(&pg->list, &m->priority_groups);
1248 pg->pg_num = pg_count;
1250 m->next_pg = pg;
1335 struct multipath *m = pgpath->pg->m;
1346 pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
1375 struct multipath *m = pgpath->pg->m;
1387 r = pgpath->pg->ps.type->reinstate_path(&pgpath->pg->ps, &pgpath->path);
1397 } else if (m->hw_handler_name && (m->current_pg == pgpath->pg)) {
1428 struct priority_group *pg;
1430 list_for_each_entry(pg, &m->priority_groups, list) {
1431 list_for_each_entry(pgpath, &pg->pgpaths, list) {
1443 static void bypass_pg(struct multipath *m, struct priority_group *pg,
1450 pg->bypassed = bypassed;
1464 struct priority_group *pg;
1476 list_for_each_entry(pg, &m->priority_groups, list) {
1477 pg->bypassed = false;
1483 m->next_pg = pg;
1497 struct priority_group *pg;
1507 list_for_each_entry(pg, &m->priority_groups, list) {
1512 bypass_pg(m, pg, bypassed);
1540 struct priority_group *pg = pgpath->pg;
1541 struct multipath *m = pg->m;
1564 * controller so try the other pg.
1566 bypass_pg(m, pg, true);
1596 pg->bypassed = false;
1681 struct path_selector *ps = &pgpath->pg->ps;
1725 struct path_selector *ps = &pgpath->pg->ps;
1805 struct priority_group *pg;
1861 list_for_each_entry(pg, &m->priority_groups, list) {
1862 if (pg->bypassed)
1864 else if (pg == m->current_pg)
1871 if (pg->ps.type->status)
1872 sz += pg->ps.type->status(&pg->ps, NULL, type,
1878 DMEMIT("%u %u ", pg->nr_pgpaths,
1879 pg->ps.type->info_args);
1881 list_for_each_entry(p, &pg->pgpaths, list) {
1885 if (pg->ps.type->status)
1886 sz += pg->ps.type->status(&pg->ps,
1894 list_for_each_entry(pg, &m->priority_groups, list) {
1895 DMEMIT("%s ", pg->ps.type->name);
1897 if (pg->ps.type->status)
1898 sz += pg->ps.type->status(&pg->ps, NULL, type,
1904 DMEMIT("%u %u ", pg->nr_pgpaths,
1905 pg->ps.type->table_args);
1907 list_for_each_entry(p, &pg->pgpaths, list) {
1909 if (pg->ps.type->status)
1910 sz += pg->ps.type->status(&pg->ps,
1924 list_for_each_entry(pg, &m->priority_groups, list) {
1925 if (pg->bypassed)
1927 else if (pg == m->current_pg)
1932 DMEMIT(",nr_pgpaths_%d=%u", pg_counter, pg->nr_pgpaths);
1933 DMEMIT(",path_selector_name_%d=%s", pg_counter, pg->ps.type->name);
1936 list_for_each_entry(p, &pg->pgpaths, list) {
1941 if (pg->ps.type->status) {
1944 sz += pg->ps.type->status(&pg->ps, &p->path,
2082 struct priority_group *pg;
2086 list_for_each_entry(pg, &m->priority_groups, list) {
2087 list_for_each_entry(p, &pg->pgpaths, list) {
2117 struct priority_group *pg, *next_pg;
2137 pg = READ_ONCE(m->current_pg);
2140 pg = next_pg;
2142 if (!pg) {
2144 * We don't know which pg will be used at next mapping time.
2155 * will be able to select it. So we consider such a pg as not busy.
2158 list_for_each_entry(pgpath, &pg->pgpaths, list) {
2170 * No active path in this pg, so this pg won't be used and