diff options
author | Tejun Heo <tj@kernel.org> | 2013-06-13 00:04:50 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-06-13 13:55:17 -0400 |
commit | 69d0206c793a17431eacee2694ee7a4b25df76b7 (patch) | |
tree | f242ce2e576886a18bec4ff6adc9cd7ba9bbe722 /include | |
parent | 5abb8855734fd7b3fa7f91c13916d0e35d99763c (diff) |
cgroup: bring some sanity to naming around cg_cgroup_link
cgroups and css_sets are mapped M:N and this M:N mapping is
represented by struct cg_cgroup_link which forms linked lists on both
sides. The naming around this mapping is already confusing and struct
cg_cgroup_link exacerbates the situation quite a bit.
>From cgroup side, it starts off ->css_sets and runs through
->cgrp_link_list. From css_set side, it starts off ->cg_links and
runs through ->cg_link_list. This is rather reversed as
cgrp_link_list is used to iterate css_sets and cg_link_list cgroups.
Also, this is the only place which is still using the confusing "cg"
for css_sets. This patch cleans it up a bit.
* s/cgroup->css_sets/cgroup->cset_links/
s/css_set->cg_links/css_set->cgrp_links/
s/cgroup_iter->cg_link/cgroup_iter->cset_link/
* s/cg_cgroup_link/cgrp_cset_link/
* s/cgrp_cset_link->cg/cgrp_cset_link->cset/
s/cgrp_cset_link->cgrp_link_list/cgrp_cset_link->cset_link/
s/cgrp_cset_link->cg_link_list/cgrp_cset_link->cgrp_link/
* s/init_css_set_link/init_cgrp_cset_link/
s/free_cg_links/free_cgrp_cset_links/
s/allocate_cg_links/allocate_cgrp_cset_links/
* s/cgl[12]/link[12]/ in compare_css_sets()
* s/saved_link/tmp_link/ s/tmp/tmp_links/ and a couple similar
adustments.
* Comment and whiteline adjustments.
After the changes, we have
list_for_each_entry(link, &cont->cset_links, cset_link) {
struct css_set *cset = link->cset;
instead of
list_for_each_entry(link, &cont->css_sets, cgrp_link_list) {
struct css_set *cset = link->cg;
This patch is purely cosmetic.
v2: Fix broken sentences in the patch description.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cgroup.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5830592258dc..0e32855edc92 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -215,10 +215,10 @@ struct cgroup { | |||
215 | struct cgroupfs_root *root; | 215 | struct cgroupfs_root *root; |
216 | 216 | ||
217 | /* | 217 | /* |
218 | * List of cg_cgroup_links pointing at css_sets with | 218 | * List of cgrp_cset_links pointing at css_sets with tasks in this |
219 | * tasks in this cgroup. Protected by css_set_lock | 219 | * cgroup. Protected by css_set_lock. |
220 | */ | 220 | */ |
221 | struct list_head css_sets; | 221 | struct list_head cset_links; |
222 | 222 | ||
223 | struct list_head allcg_node; /* cgroupfs_root->allcg_list */ | 223 | struct list_head allcg_node; /* cgroupfs_root->allcg_list */ |
224 | struct list_head cft_q_node; /* used during cftype add/rm */ | 224 | struct list_head cft_q_node; /* used during cftype add/rm */ |
@@ -365,11 +365,10 @@ struct css_set { | |||
365 | struct list_head tasks; | 365 | struct list_head tasks; |
366 | 366 | ||
367 | /* | 367 | /* |
368 | * List of cg_cgroup_link objects on link chains from | 368 | * List of cgrp_cset_links pointing at cgroups referenced from this |
369 | * cgroups referenced from this css_set. Protected by | 369 | * css_set. Protected by css_set_lock. |
370 | * css_set_lock | ||
371 | */ | 370 | */ |
372 | struct list_head cg_links; | 371 | struct list_head cgrp_links; |
373 | 372 | ||
374 | /* | 373 | /* |
375 | * Set of subsystem states, one for each subsystem. This array | 374 | * Set of subsystem states, one for each subsystem. This array |
@@ -792,7 +791,7 @@ struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, | |||
792 | 791 | ||
793 | /* A cgroup_iter should be treated as an opaque object */ | 792 | /* A cgroup_iter should be treated as an opaque object */ |
794 | struct cgroup_iter { | 793 | struct cgroup_iter { |
795 | struct list_head *cg_link; | 794 | struct list_head *cset_link; |
796 | struct list_head *task; | 795 | struct list_head *task; |
797 | }; | 796 | }; |
798 | 797 | ||