Merge tag 'x86_cache_for_6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-block.git] / block / bfq-cgroup.c
index 89ffb3aa992c1ae74e1ddec4147ed9f7e5504bc7..2c90e5de0acd94f9ba3f1920cede68856c8f66df 100644 (file)
@@ -497,15 +497,9 @@ static struct blkcg_policy_data *bfq_cpd_alloc(gfp_t gfp)
        bgd = kzalloc(sizeof(*bgd), gfp);
        if (!bgd)
                return NULL;
-       return &bgd->pd;
-}
-
-static void bfq_cpd_init(struct blkcg_policy_data *cpd)
-{
-       struct bfq_group_data *d = cpd_to_bfqgd(cpd);
 
-       d->weight = cgroup_subsys_on_dfl(io_cgrp_subsys) ?
-               CGROUP_WEIGHT_DFL : BFQ_WEIGHT_LEGACY_DFL;
+       bgd->weight = CGROUP_WEIGHT_DFL;
+       return &bgd->pd;
 }
 
 static void bfq_cpd_free(struct blkcg_policy_data *cpd)
@@ -1111,9 +1105,11 @@ static ssize_t bfq_io_set_device_weight(struct kernfs_open_file *of,
        struct bfq_group *bfqg;
        u64 v;
 
-       ret = blkg_conf_prep(blkcg, &blkcg_policy_bfq, buf, &ctx);
+       blkg_conf_init(&ctx, buf);
+
+       ret = blkg_conf_prep(blkcg, &blkcg_policy_bfq, &ctx);
        if (ret)
-               return ret;
+               goto out;
 
        if (sscanf(ctx.body, "%llu", &v) == 1) {
                /* require "default" on dfl */
@@ -1135,7 +1131,7 @@ static ssize_t bfq_io_set_device_weight(struct kernfs_open_file *of,
                ret = 0;
        }
 out:
-       blkg_conf_finish(&ctx);
+       blkg_conf_exit(&ctx);
        return ret ?: nbytes;
 }
 
@@ -1301,8 +1297,6 @@ struct blkcg_policy blkcg_policy_bfq = {
        .legacy_cftypes         = bfq_blkcg_legacy_files,
 
        .cpd_alloc_fn           = bfq_cpd_alloc,
-       .cpd_init_fn            = bfq_cpd_init,
-       .cpd_bind_fn            = bfq_cpd_init,
        .cpd_free_fn            = bfq_cpd_free,
 
        .pd_alloc_fn            = bfq_pd_alloc,