Commit 29e21368 authored by Mandeep Singh Baines's avatar Mandeep Singh Baines Committed by Tejun Heo

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: default avatarMandeep Singh Baines <msb@chromium.org>
Reviewed-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: containers@lists.linux-foundation.org
Cc: cgroups@vger.kernel.org
Cc: Paul Menage <paul@paulmenage.org>
parent 52dcf8a1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment