Re: [PATCH 3/3] cgroup: remove extra calls to find_existing_css_set

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

 



Tejun Heo (tj@xxxxxxxxxx) wrote:
> On Tue, Jan 03, 2012 at 09:18:32PM -0800, Mandeep Singh Baines wrote:
> > +out_put_css_set_refs:
> > +	if (retval) {
> > +		for (i = 0; i < css_set_refs; i++) {
> > +			tc = flex_array_get(group, i);
> > +			put_css_set(tc->cg);
> 
> Why not the following
> 
> 	for (i = 0; i < group_size; i++) {
> 		tc = flex_array_get(group, i);
> 		if (tc)
> 			put_css_set(tc->cg);
> 	}
> 
> and remove css_set_refs?
> 

If I break out of step 2 via the goto (out_put_css_set_refs), I only
want to put back the refs I've gotten so far. I could reset group_size
in that case but wanted avoid overloading group_size: someone
could later add more error path code that isn't expecting that
group_size will get re-assigned and have its meaning change.

Regards,
Mandeep

> Thanks
> 
> -- 
> tejun
_______________________________________________
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