diff options
author | Mandeep Singh Baines <msb@chromium.org> | 2011-12-15 17:21:26 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-12-19 12:14:30 -0500 |
commit | 29e21368b9baf9c4b25060d65062da2dda926c70 (patch) | |
tree | eb0d51c03f63b78317dbe329245ce7e40cb2261d /kernel | |
parent | 52dcf8a1f8ac09b6ea21266ebdc4db6d52eea1fc (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')
-rw-r--r-- | kernel/cgroup.c | 10 |
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, | |||
2025 | 2025 | ||
2026 | read_lock(&css_set_lock); | 2026 | read_lock(&css_set_lock); |
2027 | newcg = find_existing_css_set(cg, cgrp, template); | 2027 | newcg = find_existing_css_set(cg, cgrp, template); |
2028 | if (newcg) | ||
2029 | get_css_set(newcg); | ||
2030 | read_unlock(&css_set_lock); | 2028 | read_unlock(&css_set_lock); |
2031 | 2029 | ||
2032 | /* doesn't exist at all? */ | 2030 | /* doesn't exist at all? */ |
2033 | if (!newcg) | 2031 | if (!newcg) |
2034 | return false; | 2032 | return false; |
2035 | /* see if it's already in the list */ | 2033 | /* see if it's already in the list */ |
2036 | list_for_each_entry(cg_entry, newcg_list, links) { | 2034 | list_for_each_entry(cg_entry, newcg_list, links) |
2037 | if (cg_entry->cg == newcg) { | 2035 | if (cg_entry->cg == newcg) |
2038 | put_css_set(newcg); | ||
2039 | return true; | 2036 | return true; |
2040 | } | ||
2041 | } | ||
2042 | 2037 | ||
2043 | /* not found */ | 2038 | /* not found */ |
2044 | put_css_set(newcg); | ||
2045 | return false; | 2039 | return false; |
2046 | } | 2040 | } |
2047 | 2041 | ||