Lines Matching refs:pol
57 const struct blkcg_policy *pol) in blkcg_policy_enabled() argument
59 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
123 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
126 if (!blkcg_policy_enabled(q, pol)) in blkg_alloc()
130 pd = pol->pd_alloc_fn(gfp_mask, q->node); in blkg_alloc()
222 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
224 if (blkg->pd[i] && pol->pd_init_fn) in blkg_create()
225 pol->pd_init_fn(blkg->pd[i]); in blkg_create()
236 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
238 if (blkg->pd[i] && pol->pd_online_fn) in blkg_create()
239 pol->pd_online_fn(blkg->pd[i]); in blkg_create()
327 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
329 if (blkg->pd[i] && pol->pd_offline_fn) in blkg_destroy()
330 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
461 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
463 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
464 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
503 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
512 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
513 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
706 struct blkcg_policy *pol, int off) in blkg_stat_recursive_sum() argument
721 if (pol) in blkg_stat_recursive_sum()
722 stat = (void *)blkg_to_pd(pos_blkg, pol) + off; in blkg_stat_recursive_sum()
748 struct blkcg_policy *pol, int off) in blkg_rwstat_recursive_sum() argument
764 if (pol) in blkg_rwstat_recursive_sum()
765 rwstat = (void *)blkg_to_pd(pos_blkg, pol) + off; in blkg_rwstat_recursive_sum()
782 const struct blkcg_policy *pol, in blkg_lookup_check() argument
788 if (!blkcg_policy_enabled(q, pol)) in blkg_lookup_check()
813 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
845 blkg = blkg_lookup_check(blkcg, pol, q); in blkg_conf_prep()
882 blkg = blkg_lookup_check(pos, pol, q); in blkg_conf_prep()
1006 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_stat() local
1009 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_stat()
1012 written = pol->pd_stat_fn(blkg->pd[i], buf+off, size-off); in blkcg_print_stat()
1156 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1165 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1168 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1176 if (pol->cpd_init_fn) in blkcg_css_alloc()
1177 pol->cpd_init_fn(cpd); in blkcg_css_alloc()
1332 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1335 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1339 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1340 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1390 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1396 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1405 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q->node); in blkcg_activate_policy()
1417 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1420 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q->node); in blkcg_activate_policy()
1428 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1430 pd->plid = pol->plid; in blkcg_activate_policy()
1431 if (pol->pd_init_fn) in blkcg_activate_policy()
1432 pol->pd_init_fn(pd); in blkcg_activate_policy()
1435 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1445 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1459 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1463 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1473 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1476 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1477 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1478 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1479 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1480 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1500 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1519 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1520 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1524 pol->plid = i; in blkcg_policy_register()
1525 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1528 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1532 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1536 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1538 cpd->plid = pol->plid; in blkcg_policy_register()
1539 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1546 if (pol->dfl_cftypes) in blkcg_policy_register()
1548 pol->dfl_cftypes)); in blkcg_policy_register()
1549 if (pol->legacy_cftypes) in blkcg_policy_register()
1551 pol->legacy_cftypes)); in blkcg_policy_register()
1556 if (pol->cpd_free_fn) { in blkcg_policy_register()
1558 if (blkcg->cpd[pol->plid]) { in blkcg_policy_register()
1559 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_register()
1560 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_register()
1564 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1578 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1584 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1588 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1589 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1590 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1591 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1596 if (pol->cpd_free_fn) { in blkcg_policy_unregister()
1598 if (blkcg->cpd[pol->plid]) { in blkcg_policy_unregister()
1599 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_unregister()
1600 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_unregister()
1604 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()