Skip to content

Commit

Permalink
devcgroup: make a helper to convert cgroup_subsys_state to devs_cgroup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and Linus Torvalds committed Jun 6, 2008
1 parent 93b0711 commit b66862f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b66862f

Please sign in to comment.