aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:22 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:22 -0400
commit8af01f56a03e9cbd91a55d688fce1315021efba8 (patch)
tree05c051bd8b188073bb4bf695c3a46c6592e86794 /kernel/sched
parent61584e3f4964995e575618f76ff7197123796e75 (diff)
cgroup: s/cgroup_subsys_state/cgroup_css/ s/task_subsys_state/task_css/
The names of the two struct cgroup_subsys_state accessors - cgroup_subsys_state() and task_subsys_state() - are somewhat awkward. The former clashes with the type name and the latter doesn't even indicate it's somehow related to cgroup. We're about to revamp large portion of cgroup API, so, let's rename them so that they're less awkward. Most per-controller usages of the accessors are localized in accessor wrappers and given the amount of scheduled changes, this isn't gonna add any noticeable headache. Rename cgroup_subsys_state() to cgroup_css() and task_subsys_state() to task_css(). This patch is pure rename. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c4
-rw-r--r--kernel/sched/cpuacct.c4
-rw-r--r--kernel/sched/sched.h6
3 files changed, 7 insertions, 7 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9b1f2e533b95..323d907eac1a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6761,7 +6761,7 @@ void sched_move_task(struct task_struct *tsk)
6761 if (unlikely(running)) 6761 if (unlikely(running))
6762 tsk->sched_class->put_prev_task(rq, tsk); 6762 tsk->sched_class->put_prev_task(rq, tsk);
6763 6763
6764 tg = container_of(task_subsys_state_check(tsk, cpu_cgroup_subsys_id, 6764 tg = container_of(task_css_check(tsk, cpu_cgroup_subsys_id,
6765 lockdep_is_held(&tsk->sighand->siglock)), 6765 lockdep_is_held(&tsk->sighand->siglock)),
6766 struct task_group, css); 6766 struct task_group, css);
6767 tg = autogroup_task_group(tsk, tg); 6767 tg = autogroup_task_group(tsk, tg);
@@ -7086,7 +7086,7 @@ int sched_rt_handler(struct ctl_table *table, int write,
7086/* return corresponding task_group object of a cgroup */ 7086/* return corresponding task_group object of a cgroup */
7087static inline struct task_group *cgroup_tg(struct cgroup *cgrp) 7087static inline struct task_group *cgroup_tg(struct cgroup *cgrp)
7088{ 7088{
7089 return container_of(cgroup_subsys_state(cgrp, cpu_cgroup_subsys_id), 7089 return container_of(cgroup_css(cgrp, cpu_cgroup_subsys_id),
7090 struct task_group, css); 7090 struct task_group, css);
7091} 7091}
7092 7092
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index dbb7e2cd95eb..4a210faaab77 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -36,14 +36,14 @@ struct cpuacct {
36/* return cpu accounting group corresponding to this container */ 36/* return cpu accounting group corresponding to this container */
37static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp) 37static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp)
38{ 38{
39 return container_of(cgroup_subsys_state(cgrp, cpuacct_subsys_id), 39 return container_of(cgroup_css(cgrp, cpuacct_subsys_id),
40 struct cpuacct, css); 40 struct cpuacct, css);
41} 41}
42 42
43/* return cpu accounting group to which this task belongs */ 43/* return cpu accounting group to which this task belongs */
44static inline struct cpuacct *task_ca(struct task_struct *tsk) 44static inline struct cpuacct *task_ca(struct task_struct *tsk)
45{ 45{
46 return container_of(task_subsys_state(tsk, cpuacct_subsys_id), 46 return container_of(task_css(tsk, cpuacct_subsys_id),
47 struct cpuacct, css); 47 struct cpuacct, css);
48} 48}
49 49
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ef0a7b2439dd..471a56db05ea 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -665,9 +665,9 @@ extern int group_balance_cpu(struct sched_group *sg);
665/* 665/*
666 * Return the group to which this tasks belongs. 666 * Return the group to which this tasks belongs.
667 * 667 *
668 * We cannot use task_subsys_state() and friends because the cgroup 668 * We cannot use task_css() and friends because the cgroup subsystem
669 * subsystem changes that value before the cgroup_subsys::attach() method 669 * changes that value before the cgroup_subsys::attach() method is called,
670 * is called, therefore we cannot pin it and might observe the wrong value. 670 * therefore we cannot pin it and might observe the wrong value.
671 * 671 *
672 * The same is true for autogroup's p->signal->autogroup->tg, the autogroup 672 * The same is true for autogroup's p->signal->autogroup->tg, the autogroup
673 * core changes this before calling sched_move_task(). 673 * core changes this before calling sched_move_task().