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()
465 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_reset_stats() local
467 if (blkg->pd[i] && pol->pd_reset_stats_fn) in blkcg_reset_stats()
468 pol->pd_reset_stats_fn(blkg->pd[i]); in blkcg_reset_stats()
506 const struct blkcg_policy *pol, int data, in blkcg_print_blkgs() argument
515 if (blkcg_policy_enabled(blkg->q, pol)) in blkcg_print_blkgs()
516 total += prfill(sf, blkg->pd[pol->plid], data); in blkcg_print_blkgs()
548 const struct blkcg_policy *pol, in blkg_lookup_check() argument
554 if (!blkcg_policy_enabled(q, pol)) in blkg_lookup_check()
609 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, in blkg_conf_prep() argument
627 blkg = blkg_lookup_check(blkcg, pol, q); in blkg_conf_prep()
670 blkg = blkg_lookup_check(pos, pol, q); in blkg_conf_prep()
924 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_print_stat() local
927 if (!blkg->pd[i] || !pol->pd_stat_fn) in blkcg_print_stat()
930 written = pol->pd_stat_fn(blkg->pd[i], buf+off, size-off); in blkcg_print_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()
1257 struct blkcg_policy *pol = blkcg_policy[i]; in blkcg_bind() local
1260 if (!pol || !pol->cpd_bind_fn) in blkcg_bind()
1264 if (blkcg->cpd[pol->plid]) in blkcg_bind()
1265 pol->cpd_bind_fn(blkcg->cpd[pol->plid]); in blkcg_bind()
1317 const struct blkcg_policy *pol) in blkcg_activate_policy() argument
1323 if (blkcg_policy_enabled(q, pol)) in blkcg_activate_policy()
1335 if (blkg->pd[pol->plid]) in blkcg_activate_policy()
1343 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q, in blkcg_activate_policy()
1360 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1361 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q, in blkcg_activate_policy()
1369 blkg->pd[pol->plid] = pd; in blkcg_activate_policy()
1371 pd->plid = pol->plid; in blkcg_activate_policy()
1375 if (pol->pd_init_fn) in blkcg_activate_policy()
1377 pol->pd_init_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1379 __set_bit(pol->plid, q->blkcg_pols); in blkcg_activate_policy()
1389 pol->pd_free_fn(pd_prealloc); in blkcg_activate_policy()
1399 if (blkg->pd[pol->plid]) { in blkcg_activate_policy()
1400 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_activate_policy()
1401 blkg->pd[pol->plid] = NULL; in blkcg_activate_policy()
1420 const struct blkcg_policy *pol) in blkcg_deactivate_policy() argument
1424 if (!blkcg_policy_enabled(q, pol)) in blkcg_deactivate_policy()
1432 __clear_bit(pol->plid, q->blkcg_pols); in blkcg_deactivate_policy()
1438 if (blkg->pd[pol->plid]) { in blkcg_deactivate_policy()
1439 if (pol->pd_offline_fn) in blkcg_deactivate_policy()
1440 pol->pd_offline_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1441 pol->pd_free_fn(blkg->pd[pol->plid]); in blkcg_deactivate_policy()
1442 blkg->pd[pol->plid] = NULL; in blkcg_deactivate_policy()
1461 int blkcg_policy_register(struct blkcg_policy *pol) in blkcg_policy_register() argument
1480 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) || in blkcg_policy_register()
1481 (!pol->pd_alloc_fn ^ !pol->pd_free_fn)) in blkcg_policy_register()
1485 pol->plid = i; in blkcg_policy_register()
1486 blkcg_policy[pol->plid] = pol; in blkcg_policy_register()
1489 if (pol->cpd_alloc_fn) { in blkcg_policy_register()
1493 cpd = pol->cpd_alloc_fn(GFP_KERNEL); in blkcg_policy_register()
1497 blkcg->cpd[pol->plid] = cpd; in blkcg_policy_register()
1499 cpd->plid = pol->plid; in blkcg_policy_register()
1500 if (pol->cpd_init_fn) in blkcg_policy_register()
1501 pol->cpd_init_fn(cpd); in blkcg_policy_register()
1508 if (pol->dfl_cftypes) in blkcg_policy_register()
1510 pol->dfl_cftypes)); in blkcg_policy_register()
1511 if (pol->legacy_cftypes) in blkcg_policy_register()
1513 pol->legacy_cftypes)); in blkcg_policy_register()
1518 if (pol->cpd_free_fn) { in blkcg_policy_register()
1520 if (blkcg->cpd[pol->plid]) { in blkcg_policy_register()
1521 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_register()
1522 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_register()
1526 blkcg_policy[pol->plid] = NULL; in blkcg_policy_register()
1540 void blkcg_policy_unregister(struct blkcg_policy *pol) in blkcg_policy_unregister() argument
1546 if (WARN_ON(blkcg_policy[pol->plid] != pol)) in blkcg_policy_unregister()
1550 if (pol->dfl_cftypes) in blkcg_policy_unregister()
1551 cgroup_rm_cftypes(pol->dfl_cftypes); in blkcg_policy_unregister()
1552 if (pol->legacy_cftypes) in blkcg_policy_unregister()
1553 cgroup_rm_cftypes(pol->legacy_cftypes); in blkcg_policy_unregister()
1558 if (pol->cpd_free_fn) { in blkcg_policy_unregister()
1560 if (blkcg->cpd[pol->plid]) { in blkcg_policy_unregister()
1561 pol->cpd_free_fn(blkcg->cpd[pol->plid]); in blkcg_policy_unregister()
1562 blkcg->cpd[pol->plid] = NULL; in blkcg_policy_unregister()
1566 blkcg_policy[pol->plid] = NULL; in blkcg_policy_unregister()