Lines Matching refs:pol
114 const struct blkcg_policy *pol)
116 return pol && test_bit(pol->plid, q->blkcg_pols);
339 struct blkcg_policy *pol = blkcg_policy[i];
342 if (!blkcg_policy_enabled(disk->queue, pol))
346 pd = pol->pd_alloc_fn(disk, blkcg, gfp_mask);
417 struct blkcg_policy *pol = blkcg_policy[i];
419 if (blkg->pd[i] && pol->pd_init_fn)
420 pol->pd_init_fn(blkg->pd[i]);
431 struct blkcg_policy *pol = blkcg_policy[i];
434 if (pol->pd_online_fn)
435 pol->pd_online_fn(blkg->pd[i]);
546 struct blkcg_policy *pol = blkcg_policy[i];
550 if (pol->pd_offline_fn)
551 pol->pd_offline_fn(blkg->pd[i]);
612 struct blkcg_policy *pol = blkcg_policy[i];
614 if (pol)
615 __clear_bit(pol->plid, q->blkcg_pols);
651 struct blkcg_policy *pol = blkcg_policy[i];
653 if (blkg->pd[i] && pol->pd_reset_stats_fn)
654 pol->pd_reset_stats_fn(blkg->pd[i]);
675 * @pol: policy in question
680 * policy specified by @pol exists. @prfill is invoked with @sf, the
691 const struct blkcg_policy *pol, int data,
700 if (blkcg_policy_enabled(blkg->q, pol))
701 total += prfill(sf, blkg->pd[pol->plid], data);
800 * @pol: target policy
812 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
838 if (!blkcg_policy_enabled(q, pol)) {
879 if (!blkcg_policy_enabled(q, pol)) {
1146 struct blkcg_policy *pol = blkcg_policy[i];
1148 if (!blkg->pd[i] || !pol->pd_stat_fn)
1151 pol->pd_stat_fn(blkg->pd[i], s);
1352 struct blkcg_policy *pol = blkcg_policy[i];
1361 if (!pol || !pol->cpd_alloc_fn)
1364 cpd = pol->cpd_alloc_fn(GFP_KERNEL);
1499 * @pol: blkcg policy to activate
1501 * Activate @pol on @disk. Requires %GFP_KERNEL context. @disk goes through
1502 * bypass mode to populate its blkgs with policy_data for @pol.
1512 int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
1519 if (blkcg_policy_enabled(q, pol))
1531 if (blkg->pd[pol->plid])
1539 pd = pol->pd_alloc_fn(disk, blkg->blkcg,
1556 pol->pd_free_fn(pd_prealloc);
1557 pd_prealloc = pol->pd_alloc_fn(disk, blkg->blkcg,
1568 pd->plid = pol->plid;
1569 blkg->pd[pol->plid] = pd;
1571 if (pol->pd_init_fn)
1572 pol->pd_init_fn(pd);
1574 if (pol->pd_online_fn)
1575 pol->pd_online_fn(pd);
1581 __set_bit(pol->plid, q->blkcg_pols);
1591 pol->pd_free_fn(pd_prealloc);
1602 pd = blkg->pd[pol->plid];
1604 if (pd->online && pol->pd_offline_fn)
1605 pol->pd_offline_fn(pd);
1607 pol->pd_free_fn(pd);
1608 blkg->pd[pol->plid] = NULL;
1621 * @pol: blkcg policy to deactivate
1623 * Deactivate @pol on @disk. Follows the same synchronization rules as
1627 const struct blkcg_policy *pol)
1632 if (!blkcg_policy_enabled(q, pol))
1641 __clear_bit(pol->plid, q->blkcg_pols);
1647 if (blkg->pd[pol->plid]) {
1648 if (blkg->pd[pol->plid]->online && pol->pd_offline_fn)
1649 pol->pd_offline_fn(blkg->pd[pol->plid]);
1650 pol->pd_free_fn(blkg->pd[pol->plid]);
1651 blkg->pd[pol->plid] = NULL;
1664 static void blkcg_free_all_cpd(struct blkcg_policy *pol)
1669 if (blkcg->cpd[pol->plid]) {
1670 pol->cpd_free_fn(blkcg->cpd[pol->plid]);
1671 blkcg->cpd[pol->plid] = NULL;
1678 * @pol: blkcg policy to register
1680 * Register @pol with blkcg core. Might sleep and @pol may be modified on
1683 int blkcg_policy_register(struct blkcg_policy *pol)
1702 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||
1703 (!pol->pd_alloc_fn ^ !pol->pd_free_fn))
1706 /* register @pol */
1707 pol->plid = i;
1708 blkcg_policy[pol->plid] = pol;
1711 if (pol->cpd_alloc_fn) {
1715 cpd = pol->cpd_alloc_fn(GFP_KERNEL);
1719 blkcg->cpd[pol->plid] = cpd;
1721 cpd->plid = pol->plid;
1728 if (pol->dfl_cftypes)
1730 pol->dfl_cftypes));
1731 if (pol->legacy_cftypes)
1733 pol->legacy_cftypes));
1738 if (pol->cpd_free_fn)
1739 blkcg_free_all_cpd(pol);
1741 blkcg_policy[pol->plid] = NULL;
1751 * @pol: blkcg policy to unregister
1753 * Undo blkcg_policy_register(@pol). Might sleep.
1755 void blkcg_policy_unregister(struct blkcg_policy *pol)
1759 if (WARN_ON(blkcg_policy[pol->plid] != pol))
1763 if (pol->dfl_cftypes)
1764 cgroup_rm_cftypes(pol->dfl_cftypes);
1765 if (pol->legacy_cftypes)
1766 cgroup_rm_cftypes(pol->legacy_cftypes);
1771 if (pol->cpd_free_fn)
1772 blkcg_free_all_cpd(pol);
1774 blkcg_policy[pol->plid] = NULL;