Commit b66862f7 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Linus Torvalds

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: default avatarPavel Emelyanov <>
Acked-by: default avatarSerge Hallyn <>
Cc: Paul Menage <>
Cc: Balbir Singh <>
Cc: James Morris <>
Cc: Chris Wright <>
Cc: Stephen Smalley <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 93b07113
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment