Re: [PATCH 03/11] cgroup: bring some sanity to naming around cg_cgroup_link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013/6/13 5:03, Tejun Heo wrote:
> cgroups and css_sets are mapped M:N and this M:N mapping is
> represented by struct cg_cgroup_link which points to forms linked
> lists on both sides.  The naming around this already confusing struct
> is pretty bad.
> 
>>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;
> 

Those renames really make the code more readable! I have to think for a while
everytime I see those namings.

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/containers




[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux