aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-07-30 21:50:50 -0400
committerTejun Heo <tj@kernel.org>2013-07-31 07:47:34 -0400
commit4e96ee8e981b5140a2bcc5fff0d5c0eef39a62ee (patch)
treeb6ef292c7e0aa59b29ff2827bdee631d23b02eaa /include/linux/cgroup.h
parent6f4b7e632d78c2d91502211c430722cc66428492 (diff)
cgroup: convert cgroup_ida to cgroup_idr
This enables us to lookup a cgroup by its id. v4: - add a comment for idr_remove() in cgroup_offline_fn(). v3: - on success, idr_alloc() returns the id but not 0, so fix the BUG_ON() in cgroup_init(). - pass the right value to idr_alloc() so that the id for dummy cgroup is 0. Signed-off-by: Li Zefan <lizefan@huawei.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 00a7e07a1567..cca570e188fb 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -161,7 +161,7 @@ struct cgroup_name {
161struct cgroup { 161struct cgroup {
162 unsigned long flags; /* "unsigned long" so bitops work */ 162 unsigned long flags; /* "unsigned long" so bitops work */
163 163
164 int id; /* ida allocated in-hierarchy ID */ 164 int id; /* idr allocated in-hierarchy ID */
165 165
166 /* 166 /*
167 * We link our 'sibling' struct into our parent's 'children'. 167 * We link our 'sibling' struct into our parent's 'children'.
@@ -322,7 +322,7 @@ struct cgroupfs_root {
322 unsigned long flags; 322 unsigned long flags;
323 323
324 /* IDs for cgroups in this hierarchy */ 324 /* IDs for cgroups in this hierarchy */
325 struct ida cgroup_ida; 325 struct idr cgroup_idr;
326 326
327 /* The path to use for release notifications. */ 327 /* The path to use for release notifications. */
328 char release_agent_path[PATH_MAX]; 328 char release_agent_path[PATH_MAX];