Lines Matching refs:pol
61 const struct blkcg_policy *pol) in blkcg_policy_enabled() argument
63 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
171 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
174 if (!blkcg_policy_enabled(q, pol)) in blkg_alloc()
178 pd = pol->pd_alloc_fn(gfp_mask, q, blkcg); in blkg_alloc()
276 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
278 if (blkg->pd[i] && pol->pd_init_fn) in blkg_create()
279 pol->pd_init_fn(blkg->pd[i]); in blkg_create()
290 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
292 if (blkg->pd[i] && pol->pd_online_fn) in blkg_create()
293 pol->pd_online_fn(blkg->pd[i]); in blkg_create()
407 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
409 if (blkg->pd[i] && pol->pd_offline_fn) in blkg_destroy()
410 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
482 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
484 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
485 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
523 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
532 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
533 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
715 void blkg_rwstat_recursive_sum(struct blkcg_gq *blkg, struct blkcg_policy *pol, in blkg_rwstat_recursive_sum() argument
731 if (pol) in blkg_rwstat_recursive_sum()
732 rwstat = (void *)blkg_to_pd(pos_blkg, pol) + off; in blkg_rwstat_recursive_sum()
745 const struct blkcg_policy *pol, in blkg_lookup_check() argument
751 if (!blkcg_policy_enabled(q, pol)) in blkg_lookup_check()
806 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
824 blkg = blkg_lookup_check(blkcg, pol, q); in blkg_conf_prep()
861 blkg = blkg_lookup_check(pos, pol, q); in blkg_conf_prep()
983 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_stat() local
986 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_stat()
989 written = pol->pd_stat_fn(blkg->pd[i], buf+off, size-off); in blkcg_print_stat()
1139 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1148 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1151 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1159 if (pol->cpd_init_fn) in blkcg_css_alloc()
1160 pol->cpd_init_fn(cpd); in blkcg_css_alloc()
1307 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1310 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1314 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1315 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1365 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1371 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1383 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1391 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q, in blkcg_activate_policy()
1408 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1409 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q, in blkcg_activate_policy()
1417 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1419 pd->plid = pol->plid; in blkcg_activate_policy()
1423 if (pol->pd_init_fn) in blkcg_activate_policy()
1425 pol->pd_init_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1427 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1437 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1444 if (blkg->pd[pol->plid]) { in blkcg_activate_policy()
1445 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1446 blkg->pd[pol->plid] = NULL; in blkcg_activate_policy()
1464 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1468 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1476 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1479 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1480 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1481 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1482 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1483 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1501 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1520 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1521 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1525 pol->plid = i; in blkcg_policy_register()
1526 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1529 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1533 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1537 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1539 cpd->plid = pol->plid; in blkcg_policy_register()
1540 if (pol->cpd_init_fn) in blkcg_policy_register()
1541 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1548 if (pol->dfl_cftypes) in blkcg_policy_register()
1550 pol->dfl_cftypes)); in blkcg_policy_register()
1551 if (pol->legacy_cftypes) in blkcg_policy_register()
1553 pol->legacy_cftypes)); in blkcg_policy_register()
1558 if (pol->cpd_free_fn) { in blkcg_policy_register()
1560 if (blkcg->cpd[pol->plid]) { in blkcg_policy_register()
1561 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_register()
1562 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_register()
1566 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1580 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1586 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1590 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1591 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1592 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1593 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1598 if (pol->cpd_free_fn) { in blkcg_policy_unregister()
1600 if (blkcg->cpd[pol->plid]) { in blkcg_policy_unregister()
1601 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_unregister()
1602 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_unregister()
1606 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()