From: Pavel Emelyanov Date: Fri, 6 Jun 2008 05:46:24 +0000 (-0700) Subject: devcgroup: make a helper to convert cgroup_subsys_state to devs_cgroup X-Git-Tag: v2.6.26-rc6~65 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b66862f7663332aa1ecb3ebda4086360ddb8befc;p=linux-2.6-omap-h63xx.git devcgroup: make a helper to convert cgroup_subsys_state to devs_cgroup This is just picking the container_of out of cgroup_to_devcgroup into a separate function. This new css_to_devcgroup will be used in the 2nd patch. Signed-off-by: Pavel Emelyanov Acked-by: Serge Hallyn Cc: Paul Menage Cc: Balbir Singh Cc: James Morris Cc: Chris Wright Cc: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 4ea583689ee..15f2f8003ba 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -49,10 +49,14 @@ struct dev_cgroup { spinlock_t lock; }; +static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s) +{ + return container_of(s, struct dev_cgroup, css); +} + static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup) { - return container_of(cgroup_subsys_state(cgroup, devices_subsys_id), - struct dev_cgroup, css); + return css_to_devcgroup(cgroup_subsys_state(cgroup, devices_subsys_id)); } struct cgroup_subsys devices_subsys;