summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorMandeep Singh Baines <msb@chromium.org>2011-12-15 14:21:26 -0800
committerTejun Heo <tj@kernel.org>2011-12-19 09:14:30 -0800
commit29e21368b9baf9c4b25060d65062da2dda926c70 (patch)
treeeb0d51c03f63b78317dbe329245ce7e40cb2261d /kernel/cgroup.c
parent52dcf8a1f8ac09b6ea21266ebdc4db6d52eea1fc (diff)
cgroups: remove redundant get/put of css_set from css_set_check_fetched()
We already have a reference to all elements in newcg_list. Signed-off-by: Mandeep Singh Baines <msb@chromium.org> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: containers@lists.linux-foundation.org Cc: cgroups@vger.kernel.org Cc: Paul Menage <paul@paulmenage.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 1b3b84174ead..bc3caff138d8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2025,23 +2025,17 @@ static bool css_set_check_fetched(struct cgroup *cgrp,
read_lock(&css_set_lock);
newcg = find_existing_css_set(cg, cgrp, template);
- if (newcg)
- get_css_set(newcg);
read_unlock(&css_set_lock);
/* doesn't exist at all? */
if (!newcg)
return false;
/* see if it's already in the list */
- list_for_each_entry(cg_entry, newcg_list, links) {
- if (cg_entry->cg == newcg) {
- put_css_set(newcg);
+ list_for_each_entry(cg_entry, newcg_list, links)
+ if (cg_entry->cg == newcg)
return true;
- }
- }
/* not found */
- put_css_set(newcg);
return false;
}