Lines Matching refs:pol

80 				 const struct blkcg_policy *pol)  in blkcg_policy_enabled()  argument
82 return pol && test_bit(pol->plid, q->blkcg_pols); in blkcg_policy_enabled()
243 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_alloc() local
246 if (!blkcg_policy_enabled(disk->queue, pol)) in blkg_alloc()
250 pd = pol->pd_alloc_fn(gfp_mask, disk->queue, blkcg); in blkg_alloc()
312 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
314 if (blkg->pd[i] && pol->pd_init_fn) in blkg_create()
315 pol->pd_init_fn(blkg->pd[i]); in blkg_create()
326 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_create() local
328 if (blkg->pd[i] && pol->pd_online_fn) in blkg_create()
329 pol->pd_online_fn(blkg->pd[i]); in blkg_create()
432 struct blkcg_policy *pol = blkcg_policy[i]; in blkg_destroy() local
434 if (blkg->pd[i] && pol->pd_offline_fn) in blkg_destroy()
435 pol->pd_offline_fn(blkg->pd[i]); in blkg_destroy()
514 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
516 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
517 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
554 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
563 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
564 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
644 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
671 if (!blkcg_policy_enabled(q, pol)) { in blkg_conf_prep()
714 if (!blkcg_policy_enabled(q, pol)) { in blkg_conf_prep()
953 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_one_stat() local
955 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_one_stat()
958 pol->pd_stat_fn(blkg->pd[i], s); in blkcg_print_one_stat()
1158 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_css_alloc() local
1167 if (!pol || !pol->cpd_alloc_fn) in blkcg_css_alloc()
1170 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_css_alloc()
1178 if (pol->cpd_init_fn) in blkcg_css_alloc()
1179 pol->cpd_init_fn(cpd); in blkcg_css_alloc()
1288 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1291 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1295 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1296 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1347 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1353 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1365 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1373 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q, in blkcg_activate_policy()
1390 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1391 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q, in blkcg_activate_policy()
1399 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1401 pd->plid = pol->plid; in blkcg_activate_policy()
1405 if (pol->pd_init_fn) in blkcg_activate_policy()
1407 pol->pd_init_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1409 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1419 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1429 if (blkg->pd[pol->plid]) { in blkcg_activate_policy()
1430 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1431 blkg->pd[pol->plid] = NULL; in blkcg_activate_policy()
1450 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1454 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1462 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1468 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1469 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1470 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1471 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1472 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1484 static void blkcg_free_all_cpd(struct blkcg_policy *pol) in blkcg_free_all_cpd() argument
1489 if (blkcg->cpd[pol->plid]) { in blkcg_free_all_cpd()
1490 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_free_all_cpd()
1491 blkcg->cpd[pol->plid] = NULL; in blkcg_free_all_cpd()
1503 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1522 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1523 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1527 pol->plid = i; in blkcg_policy_register()
1528 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1531 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1535 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1539 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1541 cpd->plid = pol->plid; in blkcg_policy_register()
1542 if (pol->cpd_init_fn) in blkcg_policy_register()
1543 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1550 if (pol->dfl_cftypes) in blkcg_policy_register()
1552 pol->dfl_cftypes)); in blkcg_policy_register()
1553 if (pol->legacy_cftypes) in blkcg_policy_register()
1555 pol->legacy_cftypes)); in blkcg_policy_register()
1560 if (pol->cpd_free_fn) in blkcg_policy_register()
1561 blkcg_free_all_cpd(pol); in blkcg_policy_register()
1563 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1577 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1581 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1585 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1586 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1587 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1588 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1593 if (pol->cpd_free_fn) in blkcg_policy_unregister()
1594 blkcg_free_all_cpd(pol); in blkcg_policy_unregister()
1596 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()