if (!pd)
continue;
- if (pol && pol->ops.pd_exit_fn)
- pol->ops.pd_exit_fn(blkg);
+ if (pol && pol->pd_exit_fn)
+ pol->pd_exit_fn(blkg);
kfree(pd);
}
struct blkcg_policy *pol = blkcg_policy[i];
if (blkcg_policy_enabled(blkg->q, pol))
- pol->ops.pd_init_fn(blkg);
+ pol->pd_init_fn(blkg);
}
return blkg;
struct blkcg_policy *pol = blkcg_policy[i];
if (blkcg_policy_enabled(blkg->q, pol) &&
- pol->ops.pd_reset_stats_fn)
- pol->ops.pd_reset_stats_fn(blkg);
+ pol->pd_reset_stats_fn)
+ pol->pd_reset_stats_fn(blkg);
}
}
blkg->pd[pol->plid] = pd;
pd->blkg = blkg;
- pol->ops.pd_init_fn(blkg);
+ pol->pd_init_fn(blkg);
spin_unlock(&blkg->blkcg->lock);
}
/* grab blkcg lock too while removing @pd from @blkg */
spin_lock(&blkg->blkcg->lock);
- if (pol->ops.pd_exit_fn)
- pol->ops.pd_exit_fn(blkg);
+ if (pol->pd_exit_fn)
+ pol->pd_exit_fn(blkg);
kfree(blkg->pd[pol->plid]);
blkg->pd[pol->plid] = NULL;
typedef void (blkcg_pol_exit_pd_fn)(struct blkcg_gq *blkg);
typedef void (blkcg_pol_reset_pd_stats_fn)(struct blkcg_gq *blkg);
-struct blkcg_policy_ops {
- blkcg_pol_init_pd_fn *pd_init_fn;
- blkcg_pol_exit_pd_fn *pd_exit_fn;
- blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn;
-};
-
struct blkcg_policy {
- struct blkcg_policy_ops ops;
int plid;
/* policy specific private data size */
size_t pd_size;
/* cgroup files for the policy */
struct cftype *cftypes;
+
+ /* operations */
+ blkcg_pol_init_pd_fn *pd_init_fn;
+ blkcg_pol_exit_pd_fn *pd_exit_fn;
+ blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn;
};
extern struct blkcg blkcg_root;
}
static struct blkcg_policy blkcg_policy_throtl = {
- .ops = {
- .pd_init_fn = throtl_pd_init,
- .pd_exit_fn = throtl_pd_exit,
- .pd_reset_stats_fn = throtl_pd_reset_stats,
- },
- .pd_size = sizeof(struct throtl_grp),
- .cftypes = throtl_files,
+ .pd_size = sizeof(struct throtl_grp),
+ .cftypes = throtl_files,
+
+ .pd_init_fn = throtl_pd_init,
+ .pd_exit_fn = throtl_pd_exit,
+ .pd_reset_stats_fn = throtl_pd_reset_stats,
};
bool blk_throtl_bio(struct request_queue *q, struct bio *bio)
#ifdef CONFIG_CFQ_GROUP_IOSCHED
static struct blkcg_policy blkcg_policy_cfq = {
- .ops = {
- .pd_init_fn = cfq_pd_init,
- .pd_reset_stats_fn = cfq_pd_reset_stats,
- },
- .pd_size = sizeof(struct cfq_group),
- .cftypes = cfq_blkcg_files,
+ .pd_size = sizeof(struct cfq_group),
+ .cftypes = cfq_blkcg_files,
+
+ .pd_init_fn = cfq_pd_init,
+ .pd_reset_stats_fn = cfq_pd_reset_stats,
};
#endif