diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ab4ac0ccb85..cefedc8ced9 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -84,12 +84,6 @@ enum { | |||
84 | CSS_REMOVED, /* This CSS is dead */ | 84 | CSS_REMOVED, /* This CSS is dead */ |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* Caller must verify that the css is not for root cgroup */ | ||
88 | static inline void __css_get(struct cgroup_subsys_state *css, int count) | ||
89 | { | ||
90 | atomic_add(count, &css->refcnt); | ||
91 | } | ||
92 | |||
93 | /* | 87 | /* |
94 | * Call css_get() to hold a reference on the css; it can be used | 88 | * Call css_get() to hold a reference on the css; it can be used |
95 | * for a reference obtained via: | 89 | * for a reference obtained via: |
@@ -97,6 +91,7 @@ static inline void __css_get(struct cgroup_subsys_state *css, int count) | |||
97 | * - task->cgroups for a locked task | 91 | * - task->cgroups for a locked task |
98 | */ | 92 | */ |
99 | 93 | ||
94 | extern void __css_get(struct cgroup_subsys_state *css, int count); | ||
100 | static inline void css_get(struct cgroup_subsys_state *css) | 95 | static inline void css_get(struct cgroup_subsys_state *css) |
101 | { | 96 | { |
102 | /* We don't need to reference count the root state */ | 97 | /* We don't need to reference count the root state */ |
@@ -143,10 +138,7 @@ static inline void css_put(struct cgroup_subsys_state *css) | |||
143 | enum { | 138 | enum { |
144 | /* Control Group is dead */ | 139 | /* Control Group is dead */ |
145 | CGRP_REMOVED, | 140 | CGRP_REMOVED, |
146 | /* | 141 | /* Control Group has ever had a child cgroup or a task */ |
147 | * Control Group has previously had a child cgroup or a task, | ||
148 | * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) | ||
149 | */ | ||
150 | CGRP_RELEASABLE, | 142 | CGRP_RELEASABLE, |
151 | /* Control Group requires release notifications to userspace */ | 143 | /* Control Group requires release notifications to userspace */ |
152 | CGRP_NOTIFY_ON_RELEASE, | 144 | CGRP_NOTIFY_ON_RELEASE, |
@@ -287,6 +279,7 @@ struct css_set { | |||
287 | 279 | ||
288 | /* For RCU-protected deletion */ | 280 | /* For RCU-protected deletion */ |
289 | struct rcu_head rcu_head; | 281 | struct rcu_head rcu_head; |
282 | struct work_struct work; | ||
290 | }; | 283 | }; |
291 | 284 | ||
292 | /* | 285 | /* |
@@ -466,6 +459,7 @@ struct cgroup_subsys { | |||
466 | struct cgroup *cgrp); | 459 | struct cgroup *cgrp); |
467 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 460 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
468 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 461 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
462 | int (*allow_attach)(struct cgroup *cgrp, struct task_struct *tsk); | ||
469 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 463 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
470 | struct task_struct *tsk); | 464 | struct task_struct *tsk); |
471 | int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk); | 465 | int (*can_attach_task)(struct cgroup *cgrp, struct task_struct *tsk); |
@@ -539,7 +533,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
539 | */ | 533 | */ |
540 | #define task_subsys_state_check(task, subsys_id, __c) \ | 534 | #define task_subsys_state_check(task, subsys_id, __c) \ |
541 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ | 535 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ |
542 | rcu_read_lock_held() || \ | ||
543 | lockdep_is_held(&task->alloc_lock) || \ | 536 | lockdep_is_held(&task->alloc_lock) || \ |
544 | cgroup_lock_is_held() || (__c)) | 537 | cgroup_lock_is_held() || (__c)) |
545 | 538 | ||