diff options
author | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:22 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-08-08 20:11:22 -0400 |
commit | 8af01f56a03e9cbd91a55d688fce1315021efba8 (patch) | |
tree | 05c051bd8b188073bb4bf695c3a46c6592e86794 /kernel | |
parent | 61584e3f4964995e575618f76ff7197123796e75 (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')
-rw-r--r-- | kernel/cgroup.c | 2 | ||||
-rw-r--r-- | kernel/cgroup_freezer.c | 4 | ||||
-rw-r--r-- | kernel/cpuset.c | 6 | ||||
-rw-r--r-- | kernel/events/core.c | 6 | ||||
-rw-r--r-- | kernel/sched/core.c | 4 | ||||
-rw-r--r-- | kernel/sched/cpuacct.c | 4 | ||||
-rw-r--r-- | kernel/sched/sched.h | 6 |
7 files changed, 16 insertions, 16 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ae4c46834633..0b3caa3220cb 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -81,7 +81,7 @@ | |||
81 | */ | 81 | */ |
82 | #ifdef CONFIG_PROVE_RCU | 82 | #ifdef CONFIG_PROVE_RCU |
83 | DEFINE_MUTEX(cgroup_mutex); | 83 | DEFINE_MUTEX(cgroup_mutex); |
84 | EXPORT_SYMBOL_GPL(cgroup_mutex); /* only for task_subsys_state_check() */ | 84 | EXPORT_SYMBOL_GPL(cgroup_mutex); /* only for lockdep */ |
85 | #else | 85 | #else |
86 | static DEFINE_MUTEX(cgroup_mutex); | 86 | static DEFINE_MUTEX(cgroup_mutex); |
87 | #endif | 87 | #endif |
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 75dda1ea5026..9d3f61566fec 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
@@ -47,13 +47,13 @@ struct freezer { | |||
47 | 47 | ||
48 | static inline struct freezer *cgroup_freezer(struct cgroup *cgroup) | 48 | static inline struct freezer *cgroup_freezer(struct cgroup *cgroup) |
49 | { | 49 | { |
50 | return container_of(cgroup_subsys_state(cgroup, freezer_subsys_id), | 50 | return container_of(cgroup_css(cgroup, freezer_subsys_id), |
51 | struct freezer, css); | 51 | struct freezer, css); |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline struct freezer *task_freezer(struct task_struct *task) | 54 | static inline struct freezer *task_freezer(struct task_struct *task) |
55 | { | 55 | { |
56 | return container_of(task_subsys_state(task, freezer_subsys_id), | 56 | return container_of(task_css(task, freezer_subsys_id), |
57 | struct freezer, css); | 57 | struct freezer, css); |
58 | } | 58 | } |
59 | 59 | ||
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 1b9c31549797..be4512ba2c0c 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -117,14 +117,14 @@ struct cpuset { | |||
117 | /* Retrieve the cpuset for a cgroup */ | 117 | /* Retrieve the cpuset for a cgroup */ |
118 | static inline struct cpuset *cgroup_cs(struct cgroup *cgrp) | 118 | static inline struct cpuset *cgroup_cs(struct cgroup *cgrp) |
119 | { | 119 | { |
120 | return container_of(cgroup_subsys_state(cgrp, cpuset_subsys_id), | 120 | return container_of(cgroup_css(cgrp, cpuset_subsys_id), |
121 | struct cpuset, css); | 121 | struct cpuset, css); |
122 | } | 122 | } |
123 | 123 | ||
124 | /* Retrieve the cpuset for a task */ | 124 | /* Retrieve the cpuset for a task */ |
125 | static inline struct cpuset *task_cs(struct task_struct *task) | 125 | static inline struct cpuset *task_cs(struct task_struct *task) |
126 | { | 126 | { |
127 | return container_of(task_subsys_state(task, cpuset_subsys_id), | 127 | return container_of(task_css(task, cpuset_subsys_id), |
128 | struct cpuset, css); | 128 | struct cpuset, css); |
129 | } | 129 | } |
130 | 130 | ||
@@ -2724,7 +2724,7 @@ int proc_cpuset_show(struct seq_file *m, void *unused_v) | |||
2724 | goto out_free; | 2724 | goto out_free; |
2725 | 2725 | ||
2726 | rcu_read_lock(); | 2726 | rcu_read_lock(); |
2727 | css = task_subsys_state(tsk, cpuset_subsys_id); | 2727 | css = task_css(tsk, cpuset_subsys_id); |
2728 | retval = cgroup_path(css->cgroup, buf, PAGE_SIZE); | 2728 | retval = cgroup_path(css->cgroup, buf, PAGE_SIZE); |
2729 | rcu_read_unlock(); | 2729 | rcu_read_unlock(); |
2730 | if (retval < 0) | 2730 | if (retval < 0) |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 1833bc5a84a7..414c61f4d776 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -340,8 +340,8 @@ struct perf_cgroup { | |||
340 | static inline struct perf_cgroup * | 340 | static inline struct perf_cgroup * |
341 | perf_cgroup_from_task(struct task_struct *task) | 341 | perf_cgroup_from_task(struct task_struct *task) |
342 | { | 342 | { |
343 | return container_of(task_subsys_state(task, perf_subsys_id), | 343 | return container_of(task_css(task, perf_subsys_id), |
344 | struct perf_cgroup, css); | 344 | struct perf_cgroup, css); |
345 | } | 345 | } |
346 | 346 | ||
347 | static inline bool | 347 | static inline bool |
@@ -7798,7 +7798,7 @@ static struct cgroup_subsys_state *perf_cgroup_css_alloc(struct cgroup *cont) | |||
7798 | static void perf_cgroup_css_free(struct cgroup *cont) | 7798 | static void perf_cgroup_css_free(struct cgroup *cont) |
7799 | { | 7799 | { |
7800 | struct perf_cgroup *jc; | 7800 | struct perf_cgroup *jc; |
7801 | jc = container_of(cgroup_subsys_state(cont, perf_subsys_id), | 7801 | jc = container_of(cgroup_css(cont, perf_subsys_id), |
7802 | struct perf_cgroup, css); | 7802 | struct perf_cgroup, css); |
7803 | free_percpu(jc->info); | 7803 | free_percpu(jc->info); |
7804 | kfree(jc); | 7804 | kfree(jc); |
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 */ |
7087 | static inline struct task_group *cgroup_tg(struct cgroup *cgrp) | 7087 | static 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 */ |
37 | static inline struct cpuacct *cgroup_ca(struct cgroup *cgrp) | 37 | static 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 */ |
44 | static inline struct cpuacct *task_ca(struct task_struct *tsk) | 44 | static 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(). |