Lines Matching refs:pol
114 const struct blkcg_policy *pol) in blkcg_policy_enabled() argument
116 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
339 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
342 if (!blkcg_policy_enabled(disk->queue, pol)) in blkg_alloc()
346 pd = pol->pd_alloc_fn(disk, blkcg, gfp_mask); in blkg_alloc()
417 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
419 if (blkg->pd[i] && pol->pd_init_fn) in blkg_create()
420 pol->pd_init_fn(blkg->pd[i]); in blkg_create()
431 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
434 if (pol->pd_online_fn) in blkg_create()
435 pol->pd_online_fn(blkg->pd[i]); in blkg_create()
546 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
550 if (pol->pd_offline_fn) in blkg_destroy()
551 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
638 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
640 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
641 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
678 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
687 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
688 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
799 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
825 if (!blkcg_policy_enabled(q, pol)) { in blkg_conf_prep()
866 if (!blkcg_policy_enabled(q, pol)) { in blkg_conf_prep()
1133 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_one_stat() local
1135 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_one_stat()
1138 pol->pd_stat_fn(blkg->pd[i], s); in blkcg_print_one_stat()
1339 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1348 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1351 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1499 int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1506 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1518 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1526 pd = pol->pd_alloc_fn(disk, blkg->blkcg, in blkcg_activate_policy()
1543 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1544 pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg, in blkcg_activate_policy()
1555 pd->plid = pol->plid; in blkcg_activate_policy()
1556 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1558 if (pol->pd_init_fn) in blkcg_activate_policy()
1559 pol->pd_init_fn(pd); in blkcg_activate_policy()
1561 if (pol->pd_online_fn) in blkcg_activate_policy()
1562 pol->pd_online_fn(pd); in blkcg_activate_policy()
1568 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1578 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1589 pd = blkg->pd[pol->plid]; in blkcg_activate_policy()
1591 if (pd->online && pol->pd_offline_fn) in blkcg_activate_policy()
1592 pol->pd_offline_fn(pd); in blkcg_activate_policy()
1594 pol->pd_free_fn(pd); in blkcg_activate_policy()
1595 blkg->pd[pol->plid] = NULL; in blkcg_activate_policy()
1614 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1619 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1628 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1634 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1635 if (blkg->pd[pol->plid]->online && pol->pd_offline_fn) in blkcg_deactivate_policy()
1636 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1637 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1638 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1651 static void blkcg_free_all_cpd(struct blkcg_policy *pol) in blkcg_free_all_cpd() argument
1656 if (blkcg->cpd[pol->plid]) { in blkcg_free_all_cpd()
1657 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_free_all_cpd()
1658 blkcg->cpd[pol->plid] = NULL; in blkcg_free_all_cpd()
1670 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1689 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1690 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1694 pol->plid = i; in blkcg_policy_register()
1695 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1698 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1702 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1706 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1708 cpd->plid = pol->plid; in blkcg_policy_register()
1715 if (pol->dfl_cftypes) in blkcg_policy_register()
1717 pol->dfl_cftypes)); in blkcg_policy_register()
1718 if (pol->legacy_cftypes) in blkcg_policy_register()
1720 pol->legacy_cftypes)); in blkcg_policy_register()
1725 if (pol->cpd_free_fn) in blkcg_policy_register()
1726 blkcg_free_all_cpd(pol); in blkcg_policy_register()
1728 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1742 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1746 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1750 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1751 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1752 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1753 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1758 if (pol->cpd_free_fn) in blkcg_policy_unregister()
1759 blkcg_free_all_cpd(pol); in blkcg_policy_unregister()
1761 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()