Lines Matching refs:pol
61 const struct blkcg_policy *pol)
63 return pol && test_bit(pol->plid, q->blkcg_pols);
180 struct blkcg_policy *pol = blkcg_policy[i];
183 if (!blkcg_policy_enabled(q, pol))
187 pd = pol->pd_alloc_fn(gfp_mask, q, blkcg);
275 struct blkcg_policy *pol = blkcg_policy[i];
277 if (blkg->pd[i] && pol->pd_init_fn)
278 pol->pd_init_fn(blkg->pd[i]);
289 struct blkcg_policy *pol = blkcg_policy[i];
291 if (blkg->pd[i] && pol->pd_online_fn)
292 pol->pd_online_fn(blkg->pd[i]);
390 struct blkcg_policy *pol = blkcg_policy[i];
392 if (blkg->pd[i] && pol->pd_offline_fn)
393 pol->pd_offline_fn(blkg->pd[i]);
464 struct blkcg_policy *pol = blkcg_policy[i];
466 if (blkg->pd[i] && pol->pd_reset_stats_fn)
467 pol->pd_reset_stats_fn(blkg->pd[i]);
489 * @pol: policy in question
494 * policy specified by @pol exists. @prfill is invoked with @sf, the
505 const struct blkcg_policy *pol, int data,
514 if (blkcg_policy_enabled(blkg->q, pol))
515 total += prfill(sf, blkg->pd[pol->plid], data);
547 const struct blkcg_policy *pol,
553 if (!blkcg_policy_enabled(q, pol))
599 * @pol: target policy
608 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
634 blkg = blkg_lookup_check(blkcg, pol, q);
677 blkg = blkg_lookup_check(pos, pol, q);
934 struct blkcg_policy *pol = blkcg_policy[i];
937 if (!blkg->pd[i] || !pol->pd_stat_fn)
940 written = pol->pd_stat_fn(blkg->pd[i], buf+off, size-off);
1097 struct blkcg_policy *pol = blkcg_policy[i];
1106 if (!pol || !pol->cpd_alloc_fn)
1109 cpd = pol->cpd_alloc_fn(GFP_KERNEL);
1117 if (pol->cpd_init_fn)
1118 pol->cpd_init_fn(cpd);
1262 struct blkcg_policy *pol = blkcg_policy[i];
1265 if (!pol || !pol->cpd_bind_fn)
1269 if (blkcg->cpd[pol->plid])
1270 pol->cpd_bind_fn(blkcg->cpd[pol->plid]);
1308 * @pol: blkcg policy to activate
1310 * Activate @pol on @q. Requires %GFP_KERNEL context. @q goes through
1311 * bypass mode to populate its blkgs with policy_data for @pol.
1322 const struct blkcg_policy *pol)
1328 if (blkcg_policy_enabled(q, pol))
1340 if (blkg->pd[pol->plid])
1348 pd = pol->pd_alloc_fn(GFP_NOWAIT | __GFP_NOWARN, q,
1365 pol->pd_free_fn(pd_prealloc);
1366 pd_prealloc = pol->pd_alloc_fn(GFP_KERNEL, q,
1374 blkg->pd[pol->plid] = pd;
1376 pd->plid = pol->plid;
1380 if (pol->pd_init_fn)
1382 pol->pd_init_fn(blkg->pd[pol->plid]);
1384 if (pol->pd_online_fn)
1386 pol->pd_online_fn(blkg->pd[pol->plid]);
1388 __set_bit(pol->plid, q->blkcg_pols);
1398 pol->pd_free_fn(pd_prealloc);
1408 if (blkg->pd[pol->plid]) {
1409 pol->pd_free_fn(blkg->pd[pol->plid]);
1410 blkg->pd[pol->plid] = NULL;
1423 * @pol: blkcg policy to deactivate
1425 * Deactivate @pol on @q. Follows the same synchronization rules as
1429 const struct blkcg_policy *pol)
1433 if (!blkcg_policy_enabled(q, pol))
1441 __clear_bit(pol->plid, q->blkcg_pols);
1447 if (blkg->pd[pol->plid]) {
1448 if (pol->pd_offline_fn)
1449 pol->pd_offline_fn(blkg->pd[pol->plid]);
1450 pol->pd_free_fn(blkg->pd[pol->plid]);
1451 blkg->pd[pol->plid] = NULL;
1465 * @pol: blkcg policy to register
1467 * Register @pol with blkcg core. Might sleep and @pol may be modified on
1470 int blkcg_policy_register(struct blkcg_policy *pol)
1489 if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||
1490 (!pol->pd_alloc_fn ^ !pol->pd_free_fn))
1493 /* register @pol */
1494 pol->plid = i;
1495 blkcg_policy[pol->plid] = pol;
1498 if (pol->cpd_alloc_fn) {
1502 cpd = pol->cpd_alloc_fn(GFP_KERNEL);
1506 blkcg->cpd[pol->plid] = cpd;
1508 cpd->plid = pol->plid;
1509 if (pol->cpd_init_fn)
1510 pol->cpd_init_fn(cpd);
1517 if (pol->dfl_cftypes)
1519 pol->dfl_cftypes));
1520 if (pol->legacy_cftypes)
1522 pol->legacy_cftypes));
1527 if (pol->cpd_free_fn) {
1529 if (blkcg->cpd[pol->plid]) {
1530 pol->cpd_free_fn(blkcg->cpd[pol->plid]);
1531 blkcg->cpd[pol->plid] = NULL;
1535 blkcg_policy[pol->plid] = NULL;
1545 * @pol: blkcg policy to unregister
1547 * Undo blkcg_policy_register(@pol). Might sleep.
1549 void blkcg_policy_unregister(struct blkcg_policy *pol)
1555 if (WARN_ON(blkcg_policy[pol->plid] != pol))
1559 if (pol->dfl_cftypes)
1560 cgroup_rm_cftypes(pol->dfl_cftypes);
1561 if (pol->legacy_cftypes)
1562 cgroup_rm_cftypes(pol->legacy_cftypes);
1567 if (pol->cpd_free_fn) {
1569 if (blkcg->cpd[pol->plid]) {
1570 pol->cpd_free_fn(blkcg->cpd[pol->plid]);
1571 blkcg->cpd[pol->plid] = NULL;
1575 blkcg_policy[pol->plid] = NULL;