/* template: location in which to build the desired set of subsystem state objects for the new cgroup group  */
static struct css_set* find_existing_css_set(struct css_set *oldcg, struct cgroup *cgrp, struct cgroup_subsys_state *template[])
/* template: location in which to build the desired set of subsystem state objects for the new cgroup group  */
static struct css_set* find_existing_css_set(struct css_set *oldcg, struct cgroup *cgrp, struct cgroup_subsys_state *template[])
{
	int i;
	struct cgroupfs_root *root = cgrp->root;
	struct hlist_head *hhead;
	struct hlist_node *node;
	struct css_set *cg;
	for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
		if (root->subsys_bits & (1UL << i)) {
			template[i] = cgrp->subsys[i];
		} else {
			template[i] = oldcg->subsys[i];
		}
	}
	hhead = css_set_hash(template);
	hlist_for_each_entry(cg, node, hhead, hlist) {
		if (!compare_css_sets(cg, oldcg, cgrp, template))
			continue;
		return cg;
	}
	return NULL;
}