Lines Matching refs:pol
62 const struct blkcg_policy *pol) in blkcg_policy_enabled() argument
64 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
181 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
184 if (!blkcg_policy_enabled(q, pol)) in blkg_alloc()
188 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()
391 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
393 if (blkg->pd[i] && pol->pd_offline_fn) in blkg_destroy()
394 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
478 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
480 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
481 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
518 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
527 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
528 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
560 const struct blkcg_policy *pol, in blkg_lookup_check() argument
566 if (!blkcg_policy_enabled(q, pol)) in blkg_lookup_check()
621 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
639 blkg = blkg_lookup_check(blkcg, pol, q); in blkg_conf_prep()
682 blkg = blkg_lookup_check(pos, pol, q); in blkg_conf_prep()
919 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_one_stat() local
921 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_one_stat()
924 if (pol->pd_stat_fn(blkg->pd[i], s)) in blkcg_print_one_stat()
1087 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1096 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1099 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1107 if (pol->cpd_init_fn) in blkcg_css_alloc()
1108 pol->cpd_init_fn(cpd); in blkcg_css_alloc()
1231 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1234 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1238 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1239 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1290 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1296 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1308 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1316 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q, in blkcg_activate_policy()
1333 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1334 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q, in blkcg_activate_policy()
1342 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1344 pd->plid = pol->plid; in blkcg_activate_policy()
1348 if (pol->pd_init_fn) in blkcg_activate_policy()
1350 pol->pd_init_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1352 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1362 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1372 if (blkg->pd[pol->plid]) { in blkcg_activate_policy()
1373 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1374 blkg->pd[pol->plid] = NULL; in blkcg_activate_policy()
1393 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1397 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1405 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1411 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1412 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1413 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1414 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1415 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1434 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1453 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1454 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1458 pol->plid = i; in blkcg_policy_register()
1459 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1462 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1466 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1470 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1472 cpd->plid = pol->plid; in blkcg_policy_register()
1473 if (pol->cpd_init_fn) in blkcg_policy_register()
1474 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1481 if (pol->dfl_cftypes) in blkcg_policy_register()
1483 pol->dfl_cftypes)); in blkcg_policy_register()
1484 if (pol->legacy_cftypes) in blkcg_policy_register()
1486 pol->legacy_cftypes)); in blkcg_policy_register()
1491 if (pol->cpd_free_fn) { in blkcg_policy_register()
1493 if (blkcg->cpd[pol->plid]) { in blkcg_policy_register()
1494 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_register()
1495 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_register()
1499 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1513 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1519 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1523 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1524 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1525 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1526 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1531 if (pol->cpd_free_fn) { in blkcg_policy_unregister()
1533 if (blkcg->cpd[pol->plid]) { in blkcg_policy_unregister()
1534 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_unregister()
1535 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_unregister()
1539 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()