diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5db8138a0482..b0d5f53ae5e1 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -225,6 +225,9 @@ struct cgroup { | |||
225 | struct list_head pidlists; | 225 | struct list_head pidlists; |
226 | struct mutex pidlist_mutex; | 226 | struct mutex pidlist_mutex; |
227 | 227 | ||
228 | /* dummy css with NULL ->ss, points back to this cgroup */ | ||
229 | struct cgroup_subsys_state dummy_css; | ||
230 | |||
228 | /* For css percpu_ref killing and RCU-protected deletion */ | 231 | /* For css percpu_ref killing and RCU-protected deletion */ |
229 | struct rcu_head rcu_head; | 232 | struct rcu_head rcu_head; |
230 | struct work_struct destroy_work; | 233 | struct work_struct destroy_work; |
@@ -668,7 +671,13 @@ struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css) | |||
668 | { | 671 | { |
669 | struct cgroup *parent_cgrp = css->cgroup->parent; | 672 | struct cgroup *parent_cgrp = css->cgroup->parent; |
670 | 673 | ||
671 | return parent_cgrp ? parent_cgrp->subsys[css->ss->subsys_id] : NULL; | 674 | if (!parent_cgrp) |
675 | return NULL; | ||
676 | |||
677 | if (css->ss) | ||
678 | return parent_cgrp->subsys[css->ss->subsys_id]; | ||
679 | else | ||
680 | return &parent_cgrp->dummy_css; | ||
672 | } | 681 | } |
673 | 682 | ||
674 | /** | 683 | /** |