Lines Matching refs:pol
53 const struct blkcg_policy *pol) in blkcg_policy_enabled() argument
55 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
119 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
122 if (!blkcg_policy_enabled(q, pol)) in blkg_alloc()
126 pd = pol->pd_alloc_fn(gfp_mask, q->node); in blkg_alloc()
217 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
219 if (blkg->pd[i] && pol->pd_init_fn) in blkg_create()
220 pol->pd_init_fn(blkg->pd[i]); in blkg_create()
231 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
233 if (blkg->pd[i] && pol->pd_online_fn) in blkg_create()
234 pol->pd_online_fn(blkg->pd[i]); in blkg_create()
322 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
324 if (blkg->pd[i] && pol->pd_offline_fn) in blkg_destroy()
325 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
456 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
458 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
459 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
498 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
507 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
508 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
699 struct blkcg_policy *pol, int off) in blkg_stat_recursive_sum() argument
714 if (pol) in blkg_stat_recursive_sum()
715 stat = (void *)blkg_to_pd(pos_blkg, pol) + off; in blkg_stat_recursive_sum()
741 struct blkcg_policy *pol, int off) in blkg_rwstat_recursive_sum() argument
757 if (pol) in blkg_rwstat_recursive_sum()
758 rwstat = (void *)blkg_to_pd(pos_blkg, pol) + off; in blkg_rwstat_recursive_sum()
785 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
814 if (blkcg_policy_enabled(disk->queue, pol)) in blkg_conf_prep()
991 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1000 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1003 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1011 if (pol->cpd_init_fn) in blkcg_css_alloc()
1012 pol->cpd_init_fn(cpd); in blkcg_css_alloc()
1157 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1160 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1164 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1165 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1207 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1213 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1219 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q->node); in blkcg_activate_policy()
1231 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1234 pd = pol->pd_alloc_fn(GFP_NOWAIT, q->node); in blkcg_activate_policy()
1242 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1244 pd->plid = pol->plid; in blkcg_activate_policy()
1245 if (pol->pd_init_fn) in blkcg_activate_policy()
1246 pol->pd_init_fn(pd); in blkcg_activate_policy()
1249 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1256 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1270 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1274 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1280 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1286 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1287 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1288 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1289 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1290 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1308 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1325 pol->plid = i; in blkcg_policy_register()
1326 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1329 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1333 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1339 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1341 cpd->plid = pol->plid; in blkcg_policy_register()
1342 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1349 if (pol->dfl_cftypes) in blkcg_policy_register()
1351 pol->dfl_cftypes)); in blkcg_policy_register()
1352 if (pol->legacy_cftypes) in blkcg_policy_register()
1354 pol->legacy_cftypes)); in blkcg_policy_register()
1359 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1361 if (blkcg->cpd[pol->plid]) { in blkcg_policy_register()
1362 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_register()
1363 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_register()
1367 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1381 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1387 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1391 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1392 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1393 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1394 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1399 if (pol->cpd_alloc_fn) { in blkcg_policy_unregister()
1401 if (blkcg->cpd[pol->plid]) { in blkcg_policy_unregister()
1402 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_unregister()
1403 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_unregister()
1407 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()