blk-cgroup: delete cpd_bind_fn of blkcg_policy
authorChengming Zhou <zhouchengming@bytedance.com>
Thu, 6 Apr 2023 14:50:49 +0000 (22:50 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 6 Apr 2023 22:17:32 +0000 (16:17 -0600)
cpd_bind_fn is just used for update default weight when block
subsys attached to a hierarchy. No any policy need it anymore.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230406145050.49914-3-zhouchengming@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c
block/blk-cgroup.h

index bd50b55bdb61353188543719fa992f8d1a7192eb..68b797b3f114efb2e15e0b4f78785fd1e369a8f0 100644 (file)
@@ -1355,26 +1355,6 @@ void blkcg_exit_disk(struct gendisk *disk)
        blk_throtl_exit(disk);
 }
 
-static void blkcg_bind(struct cgroup_subsys_state *root_css)
-{
-       int i;
-
-       mutex_lock(&blkcg_pol_mutex);
-
-       for (i = 0; i < BLKCG_MAX_POLS; i++) {
-               struct blkcg_policy *pol = blkcg_policy[i];
-               struct blkcg *blkcg;
-
-               if (!pol || !pol->cpd_bind_fn)
-                       continue;
-
-               list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node)
-                       if (blkcg->cpd[pol->plid])
-                               pol->cpd_bind_fn(blkcg->cpd[pol->plid]);
-       }
-       mutex_unlock(&blkcg_pol_mutex);
-}
-
 static void blkcg_exit(struct task_struct *tsk)
 {
        if (tsk->throttle_disk)
@@ -1388,7 +1368,6 @@ struct cgroup_subsys io_cgrp_subsys = {
        .css_offline = blkcg_css_offline,
        .css_free = blkcg_css_free,
        .css_rstat_flush = blkcg_rstat_flush,
-       .bind = blkcg_bind,
        .dfl_cftypes = blkcg_files,
        .legacy_cftypes = blkcg_legacy_files,
        .legacy_name = "blkio",
index 9c5078755e5e19cbda6db1616746c7244dd6c2b1..26ce62663e279fe0741300aeb7af3513e5d9ccf1 100644 (file)
@@ -175,7 +175,6 @@ struct blkcg_policy {
        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_bind_cpd_fn           *cpd_bind_fn;
 
        blkcg_pol_alloc_pd_fn           *pd_alloc_fn;
        blkcg_pol_init_pd_fn            *pd_init_fn;