aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Emelyanov2008-06-06 00:46:24 -0500
committerLinus Torvalds2008-06-06 13:29:11 -0500
commitb66862f7663332aa1ecb3ebda4086360ddb8befc (patch)
tree8ba5a907f4bafad460cef4d6c573b9f5aae957e5 /security/device_cgroup.c
parent93b071139a956e51c98cdefd50a47981a4eb852e (diff)
downloadam43-linux-kernel-b66862f7663332aa1ecb3ebda4086360ddb8befc.tar.gz
am43-linux-kernel-b66862f7663332aa1ecb3ebda4086360ddb8befc.tar.xz
am43-linux-kernel-b66862f7663332aa1ecb3ebda4086360ddb8befc.zip
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 <xemul@openvz.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Cc: Paul Menage <menage@google.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: James Morris <jmorris@namei.org> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/device_cgroup.c')
-rw-r--r--security/device_cgroup.c8
1 files changed, 6 insertions, 2 deletions
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 {
49 spinlock_t lock; 49 spinlock_t lock;
50}; 50};
51 51
52static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
53{
54 return container_of(s, struct dev_cgroup, css);
55}
56
52static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup) 57static inline struct dev_cgroup *cgroup_to_devcgroup(struct cgroup *cgroup)
53{ 58{
54 return container_of(cgroup_subsys_state(cgroup, devices_subsys_id), 59 return css_to_devcgroup(cgroup_subsys_state(cgroup, devices_subsys_id));
55 struct dev_cgroup, css);
56} 60}
57 61
58struct cgroup_subsys devices_subsys; 62struct cgroup_subsys devices_subsys;