summaryrefslogtreecommitdiff
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorMichal Koutný <mkoutny@suse.com>2025-03-11 13:36:28 +0100
committerTejun Heo <tj@kernel.org>2025-03-11 09:22:55 -1000
commit4a893bdc18df087ab7dde28a4e8066ae39faa700 (patch)
tree0d360df7bb6ff566859ab30cba3a845cbf8854aa /block/blk-cgroup.c
parent76f9409f813c9dc24a22fa7a587a31983706c4d5 (diff)
downloadlinux-4a893bdc18df087ab7dde28a4e8066ae39faa700.tar.gz
linux-4a893bdc18df087ab7dde28a4e8066ae39faa700.tar.bz2
linux-4a893bdc18df087ab7dde28a4e8066ae39faa700.zip
blk-cgroup: Simplify policy files registration
Use one set of files when there is no difference between default and legacy files, similar to regular subsys files registration. No functional change. Signed-off-by: Michal Koutný <mkoutny@suse.com> Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index b3e5184b10d5..fa26b33b540e 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1768,12 +1768,15 @@ int blkcg_policy_register(struct blkcg_policy *pol)
mutex_unlock(&blkcg_pol_mutex);
/* everything is in place, add intf files for the new policy */
- if (pol->dfl_cftypes)
+ if (pol->dfl_cftypes == pol->legacy_cftypes) {
+ WARN_ON(cgroup_add_cftypes(&io_cgrp_subsys,
+ pol->dfl_cftypes));
+ } else {
WARN_ON(cgroup_add_dfl_cftypes(&io_cgrp_subsys,
pol->dfl_cftypes));
- if (pol->legacy_cftypes)
WARN_ON(cgroup_add_legacy_cftypes(&io_cgrp_subsys,
pol->legacy_cftypes));
+ }
mutex_unlock(&blkcg_pol_register_mutex);
return 0;