diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-08 10:36:58 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-08 10:36:58 -0500 |
commit | aec25020f5d4b69aea5317551d1cb7043f6b04fb (patch) | |
tree | ed9c89b1468542a9d5be6f20af24db8d6251c90b /kernel | |
parent | 073219e995b4a3f8cf1ce8228b7ef440b6994ac0 (diff) |
cgroup: rename cgroup_subsys->subsys_id to ->id
It's no longer referenced outside cgroup core, so renaming is easy.
Let's rename it for consistency & brevity.
This patch is pure rename.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index fe3f7253aa90..5a77ca0784a6 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -198,7 +198,7 @@ static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp, | |||
198 | struct cgroup_subsys *ss) | 198 | struct cgroup_subsys *ss) |
199 | { | 199 | { |
200 | if (ss) | 200 | if (ss) |
201 | return rcu_dereference_check(cgrp->subsys[ss->subsys_id], | 201 | return rcu_dereference_check(cgrp->subsys[ss->id], |
202 | lockdep_is_held(&cgroup_mutex)); | 202 | lockdep_is_held(&cgroup_mutex)); |
203 | else | 203 | else |
204 | return &cgrp->dummy_css; | 204 | return &cgrp->dummy_css; |
@@ -3982,7 +3982,7 @@ static void css_release(struct percpu_ref *ref) | |||
3982 | struct cgroup_subsys_state *css = | 3982 | struct cgroup_subsys_state *css = |
3983 | container_of(ref, struct cgroup_subsys_state, refcnt); | 3983 | container_of(ref, struct cgroup_subsys_state, refcnt); |
3984 | 3984 | ||
3985 | rcu_assign_pointer(css->cgroup->subsys[css->ss->subsys_id], NULL); | 3985 | rcu_assign_pointer(css->cgroup->subsys[css->ss->id], NULL); |
3986 | call_rcu(&css->rcu_head, css_free_rcu_fn); | 3986 | call_rcu(&css->rcu_head, css_free_rcu_fn); |
3987 | } | 3987 | } |
3988 | 3988 | ||
@@ -4014,7 +4014,7 @@ static int online_css(struct cgroup_subsys_state *css) | |||
4014 | if (!ret) { | 4014 | if (!ret) { |
4015 | css->flags |= CSS_ONLINE; | 4015 | css->flags |= CSS_ONLINE; |
4016 | css->cgroup->nr_css++; | 4016 | css->cgroup->nr_css++; |
4017 | rcu_assign_pointer(css->cgroup->subsys[ss->subsys_id], css); | 4017 | rcu_assign_pointer(css->cgroup->subsys[ss->id], css); |
4018 | } | 4018 | } |
4019 | return ret; | 4019 | return ret; |
4020 | } | 4020 | } |
@@ -4034,7 +4034,7 @@ static void offline_css(struct cgroup_subsys_state *css) | |||
4034 | 4034 | ||
4035 | css->flags &= ~CSS_ONLINE; | 4035 | css->flags &= ~CSS_ONLINE; |
4036 | css->cgroup->nr_css--; | 4036 | css->cgroup->nr_css--; |
4037 | RCU_INIT_POINTER(css->cgroup->subsys[ss->subsys_id], css); | 4037 | RCU_INIT_POINTER(css->cgroup->subsys[ss->id], css); |
4038 | } | 4038 | } |
4039 | 4039 | ||
4040 | /** | 4040 | /** |
@@ -4065,7 +4065,7 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
4065 | 4065 | ||
4066 | init_css(css, ss, cgrp); | 4066 | init_css(css, ss, cgrp); |
4067 | 4067 | ||
4068 | err = cgroup_populate_dir(cgrp, 1 << ss->subsys_id); | 4068 | err = cgroup_populate_dir(cgrp, 1 << ss->id); |
4069 | if (err) | 4069 | if (err) |
4070 | goto err_free; | 4070 | goto err_free; |
4071 | 4071 | ||
@@ -4292,7 +4292,7 @@ static void css_killed_ref_fn(struct percpu_ref *ref) | |||
4292 | */ | 4292 | */ |
4293 | static void kill_css(struct cgroup_subsys_state *css) | 4293 | static void kill_css(struct cgroup_subsys_state *css) |
4294 | { | 4294 | { |
4295 | cgroup_clear_dir(css->cgroup, 1 << css->ss->subsys_id); | 4295 | cgroup_clear_dir(css->cgroup, 1 << css->ss->id); |
4296 | 4296 | ||
4297 | /* | 4297 | /* |
4298 | * Killing would put the base ref, but we need to keep it alive | 4298 | * Killing would put the base ref, but we need to keep it alive |
@@ -4496,7 +4496,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss) | |||
4496 | * pointer to this state - since the subsystem is | 4496 | * pointer to this state - since the subsystem is |
4497 | * newly registered, all tasks and hence the | 4497 | * newly registered, all tasks and hence the |
4498 | * init_css_set is in the subsystem's top cgroup. */ | 4498 | * init_css_set is in the subsystem's top cgroup. */ |
4499 | init_css_set.subsys[ss->subsys_id] = css; | 4499 | init_css_set.subsys[ss->id] = css; |
4500 | 4500 | ||
4501 | need_forkexit_callback |= ss->fork || ss->exit; | 4501 | need_forkexit_callback |= ss->fork || ss->exit; |
4502 | 4502 | ||
@@ -4536,14 +4536,14 @@ int __init cgroup_init_early(void) | |||
4536 | list_add(&init_cgrp_cset_link.cgrp_link, &init_css_set.cgrp_links); | 4536 | list_add(&init_cgrp_cset_link.cgrp_link, &init_css_set.cgrp_links); |
4537 | 4537 | ||
4538 | for_each_subsys(ss, i) { | 4538 | for_each_subsys(ss, i) { |
4539 | WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->subsys_id, | 4539 | WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id, |
4540 | "invalid cgroup_subsys %d:%s css_alloc=%p css_free=%p name:id=%d:%s\n", | 4540 | "invalid cgroup_subsys %d:%s css_alloc=%p css_free=%p name:id=%d:%s\n", |
4541 | i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, | 4541 | i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, |
4542 | ss->subsys_id, ss->name); | 4542 | ss->id, ss->name); |
4543 | WARN(strlen(cgroup_subsys_name[i]) > MAX_CGROUP_TYPE_NAMELEN, | 4543 | WARN(strlen(cgroup_subsys_name[i]) > MAX_CGROUP_TYPE_NAMELEN, |
4544 | "cgroup_subsys_name %s too long\n", cgroup_subsys_name[i]); | 4544 | "cgroup_subsys_name %s too long\n", cgroup_subsys_name[i]); |
4545 | 4545 | ||
4546 | ss->subsys_id = i; | 4546 | ss->id = i; |
4547 | ss->name = cgroup_subsys_name[i]; | 4547 | ss->name = cgroup_subsys_name[i]; |
4548 | 4548 | ||
4549 | if (ss->early_init) | 4549 | if (ss->early_init) |