init_cgroup_housekeeping(cgrp);
}
-static int cgroup_init_root_id(struct cgroupfs_root *root)
+static int cgroup_init_root_id(struct cgroupfs_root *root, int start, int end)
{
int id;
lockdep_assert_held(&cgroup_mutex);
lockdep_assert_held(&cgroup_root_mutex);
- id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, 2, 0, GFP_KERNEL);
+ id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, start, end,
+ GFP_KERNEL);
if (id < 0)
return id;
if (ret)
goto unlock_drop;
- ret = cgroup_init_root_id(root);
+ /* ID 0 is reserved for dummy root, 1 for unified hierarchy */
+ ret = cgroup_init_root_id(root, 2, 0);
if (ret)
goto unlock_drop;
key = css_set_hash(init_css_set.subsys);
hash_add(css_set_table, &init_css_set.hlist, key);
- BUG_ON(cgroup_init_root_id(&cgroup_dummy_root));
+ BUG_ON(cgroup_init_root_id(&cgroup_dummy_root, 0, 1));
mutex_unlock(&cgroup_root_mutex);
mutex_unlock(&cgroup_mutex);