Commit 650e2cb5 authored by Chengming Zhou's avatar Chengming Zhou Committed by Jens Axboe

blk-cgroup: delete cpd_init_fn of blkcg_policy

blkcg_policy cpd_init_fn() is used to just initialize some default
fields of policy data, which is enough to do in cpd_alloc_fn().

This patch delete the only user bfq_cpd_init(), and remove cpd_init_fn
from blkcg_policy.
Signed-off-by: default avatarChengming Zhou <zhouchengming@bytedance.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230406145050.49914-4-zhouchengming@bytedance.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d1023165
...@@ -497,14 +497,9 @@ static struct blkcg_policy_data *bfq_cpd_alloc(gfp_t gfp) ...@@ -497,14 +497,9 @@ static struct blkcg_policy_data *bfq_cpd_alloc(gfp_t gfp)
bgd = kzalloc(sizeof(*bgd), gfp); bgd = kzalloc(sizeof(*bgd), gfp);
if (!bgd) if (!bgd)
return NULL; return NULL;
return &bgd->pd;
}
static void bfq_cpd_init(struct blkcg_policy_data *cpd) bgd->weight = CGROUP_WEIGHT_DFL;
{ return &bgd->pd;
struct bfq_group_data *d = cpd_to_bfqgd(cpd);
d->weight = CGROUP_WEIGHT_DFL;
} }
static void bfq_cpd_free(struct blkcg_policy_data *cpd) static void bfq_cpd_free(struct blkcg_policy_data *cpd)
...@@ -1300,7 +1295,6 @@ struct blkcg_policy blkcg_policy_bfq = { ...@@ -1300,7 +1295,6 @@ struct blkcg_policy blkcg_policy_bfq = {
.legacy_cftypes = bfq_blkcg_legacy_files, .legacy_cftypes = bfq_blkcg_legacy_files,
.cpd_alloc_fn = bfq_cpd_alloc, .cpd_alloc_fn = bfq_cpd_alloc,
.cpd_init_fn = bfq_cpd_init,
.cpd_free_fn = bfq_cpd_free, .cpd_free_fn = bfq_cpd_free,
.pd_alloc_fn = bfq_pd_alloc, .pd_alloc_fn = bfq_pd_alloc,
......
...@@ -1249,8 +1249,6 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css) ...@@ -1249,8 +1249,6 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css)
blkcg->cpd[i] = cpd; blkcg->cpd[i] = cpd;
cpd->blkcg = blkcg; cpd->blkcg = blkcg;
cpd->plid = i; cpd->plid = i;
if (pol->cpd_init_fn)
pol->cpd_init_fn(cpd);
} }
spin_lock_init(&blkcg->lock); spin_lock_init(&blkcg->lock);
...@@ -1605,8 +1603,6 @@ int blkcg_policy_register(struct blkcg_policy *pol) ...@@ -1605,8 +1603,6 @@ int blkcg_policy_register(struct blkcg_policy *pol)
blkcg->cpd[pol->plid] = cpd; blkcg->cpd[pol->plid] = cpd;
cpd->blkcg = blkcg; cpd->blkcg = blkcg;
cpd->plid = pol->plid; cpd->plid = pol->plid;
if (pol->cpd_init_fn)
pol->cpd_init_fn(cpd);
} }
} }
......
...@@ -173,7 +173,6 @@ struct blkcg_policy { ...@@ -173,7 +173,6 @@ struct blkcg_policy {
/* operations */ /* operations */
blkcg_pol_alloc_cpd_fn *cpd_alloc_fn; blkcg_pol_alloc_cpd_fn *cpd_alloc_fn;
blkcg_pol_init_cpd_fn *cpd_init_fn;
blkcg_pol_free_cpd_fn *cpd_free_fn; blkcg_pol_free_cpd_fn *cpd_free_fn;
blkcg_pol_alloc_pd_fn *pd_alloc_fn; blkcg_pol_alloc_pd_fn *pd_alloc_fn;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment