From: Dhaval Giani Date: Fri, 29 Jun 2012 09:37:39 +0000 (+0530) Subject: libcgroup: Add a cgroup element to point to the owner in the controller X-Git-Tag: v0.41~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24de1da89def830bcc267e57da0d7f0bb8dcb904;p=thirdparty%2Flibcgroup.git libcgroup: Add a cgroup element to point to the owner in the controller Since the only way to create a controller is from the wrapper API, it is always linked to one cgroup. Since it would help knowing which cgroup a controller belongs to, let's just add that information in there. Signed-off-by: Dhaval Giani Cc: Glauber Costa --- diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index b253828e..8bcfd969 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -77,6 +77,7 @@ struct control_value { struct cgroup_controller { char name[FILENAME_MAX]; struct control_value *values[CG_NV_MAX]; + struct cgroup *cgroup; int index; }; diff --git a/src/wrapper.c b/src/wrapper.c index 46180055..dfcfc8f4 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -83,6 +83,7 @@ struct cgroup_controller *cgroup_add_controller(struct cgroup *cgroup, return NULL; strncpy(controller->name, name, sizeof(controller->name)); + controller->cgroup = cgroup; controller->index = 0; cgroup->controller[cgroup->index] = controller;