aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-05-13 16:24:16 -0400
committerTejun Heo <tj@kernel.org>2015-05-18 15:52:20 -0400
commitc326aa2bb2209e10df4a381801bb34ca0f923038 (patch)
treed2824a14cc8ec45c053de70545ee5e4afa4872a4 /include/linux/cgroup.h
parentb4a04ab7a37b490cad48e69abfe14288cacb669c (diff)
cgroup: reorganize include/linux/cgroup.h
From c4d440938b5e2015c70594fe6666a099c844f929 Mon Sep 17 00:00:00 2001 From: Tejun Heo <tj@kernel.org> Date: Wed, 13 May 2015 16:21:40 -0400 Over time, cgroup.h grew organically and doesn't have much logical structure at this point. Separation of cgroup-defs.h in the previous patch gives us a good chance for reorganizing cgroup.h as changes to the header are likely to cause conflicts anyway. This patch reorganizes cgroup.h so that it has consistent logical grouping. This is pure reorganization. v2: Relocating #ifdef CONFIG_CGROUPS caused build failure when cgroup is disabled. Dropped. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h552
1 files changed, 271 insertions, 281 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 96a2ecd5aa69..82319fb31cfe 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -22,16 +22,189 @@
22 22
23#ifdef CONFIG_CGROUPS 23#ifdef CONFIG_CGROUPS
24 24
25extern int cgroup_init_early(void); 25/* a css_task_iter should be treated as an opaque object */
26extern int cgroup_init(void); 26struct css_task_iter {
27extern void cgroup_fork(struct task_struct *p); 27 struct cgroup_subsys *ss;
28extern void cgroup_post_fork(struct task_struct *p); 28
29extern void cgroup_exit(struct task_struct *p); 29 struct list_head *cset_pos;
30extern int cgroupstats_build(struct cgroupstats *stats, 30 struct list_head *cset_head;
31 struct dentry *dentry); 31
32 struct list_head *task_pos;
33 struct list_head *tasks_head;
34 struct list_head *mg_tasks_head;
35};
36
37extern struct cgroup_root cgrp_dfl_root;
38extern struct css_set init_css_set;
39
40#define SUBSYS(_x) extern struct cgroup_subsys _x ## _cgrp_subsys;
41#include <linux/cgroup_subsys.h>
42#undef SUBSYS
43
44bool css_has_online_children(struct cgroup_subsys_state *css);
45struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
46struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup,
47 struct cgroup_subsys *ss);
48struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
49 struct cgroup_subsys *ss);
50
51bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
52int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
53int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
54
55int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
56int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
57int cgroup_rm_cftypes(struct cftype *cfts);
58
59char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);
60int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry);
61int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns,
62 struct pid *pid, struct task_struct *tsk);
63
64void cgroup_fork(struct task_struct *p);
65void cgroup_post_fork(struct task_struct *p);
66void cgroup_exit(struct task_struct *p);
67
68int cgroup_init_early(void);
69int cgroup_init(void);
70
71/*
72 * Iteration helpers and macros.
73 */
74
75struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
76 struct cgroup_subsys_state *parent);
77struct cgroup_subsys_state *css_next_descendant_pre(struct cgroup_subsys_state *pos,
78 struct cgroup_subsys_state *css);
79struct cgroup_subsys_state *css_rightmost_descendant(struct cgroup_subsys_state *pos);
80struct cgroup_subsys_state *css_next_descendant_post(struct cgroup_subsys_state *pos,
81 struct cgroup_subsys_state *css);
82
83struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
84struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
85
86void css_task_iter_start(struct cgroup_subsys_state *css,
87 struct css_task_iter *it);
88struct task_struct *css_task_iter_next(struct css_task_iter *it);
89void css_task_iter_end(struct css_task_iter *it);
90
91/**
92 * css_for_each_child - iterate through children of a css
93 * @pos: the css * to use as the loop cursor
94 * @parent: css whose children to walk
95 *
96 * Walk @parent's children. Must be called under rcu_read_lock().
97 *
98 * If a subsystem synchronizes ->css_online() and the start of iteration, a
99 * css which finished ->css_online() is guaranteed to be visible in the
100 * future iterations and will stay visible until the last reference is put.
101 * A css which hasn't finished ->css_online() or already finished
102 * ->css_offline() may show up during traversal. It's each subsystem's
103 * responsibility to synchronize against on/offlining.
104 *
105 * It is allowed to temporarily drop RCU read lock during iteration. The
106 * caller is responsible for ensuring that @pos remains accessible until
107 * the start of the next iteration by, for example, bumping the css refcnt.
108 */
109#define css_for_each_child(pos, parent) \
110 for ((pos) = css_next_child(NULL, (parent)); (pos); \
111 (pos) = css_next_child((pos), (parent)))
112
113/**
114 * css_for_each_descendant_pre - pre-order walk of a css's descendants
115 * @pos: the css * to use as the loop cursor
116 * @root: css whose descendants to walk
117 *
118 * Walk @root's descendants. @root is included in the iteration and the
119 * first node to be visited. Must be called under rcu_read_lock().
120 *
121 * If a subsystem synchronizes ->css_online() and the start of iteration, a
122 * css which finished ->css_online() is guaranteed to be visible in the
123 * future iterations and will stay visible until the last reference is put.
124 * A css which hasn't finished ->css_online() or already finished
125 * ->css_offline() may show up during traversal. It's each subsystem's
126 * responsibility to synchronize against on/offlining.
127 *
128 * For example, the following guarantees that a descendant can't escape
129 * state updates of its ancestors.
130 *
131 * my_online(@css)
132 * {
133 * Lock @css's parent and @css;
134 * Inherit state from the parent;
135 * Unlock both.
136 * }
137 *
138 * my_update_state(@css)
139 * {
140 * css_for_each_descendant_pre(@pos, @css) {
141 * Lock @pos;
142 * if (@pos == @css)
143 * Update @css's state;
144 * else
145 * Verify @pos is alive and inherit state from its parent;
146 * Unlock @pos;
147 * }
148 * }
149 *
150 * As long as the inheriting step, including checking the parent state, is
151 * enclosed inside @pos locking, double-locking the parent isn't necessary
152 * while inheriting. The state update to the parent is guaranteed to be
153 * visible by walking order and, as long as inheriting operations to the
154 * same @pos are atomic to each other, multiple updates racing each other
155 * still result in the correct state. It's guaranateed that at least one
156 * inheritance happens for any css after the latest update to its parent.
157 *
158 * If checking parent's state requires locking the parent, each inheriting
159 * iteration should lock and unlock both @pos->parent and @pos.
160 *
161 * Alternatively, a subsystem may choose to use a single global lock to
162 * synchronize ->css_online() and ->css_offline() against tree-walking
163 * operations.
164 *
165 * It is allowed to temporarily drop RCU read lock during iteration. The
166 * caller is responsible for ensuring that @pos remains accessible until
167 * the start of the next iteration by, for example, bumping the css refcnt.
168 */
169#define css_for_each_descendant_pre(pos, css) \
170 for ((pos) = css_next_descendant_pre(NULL, (css)); (pos); \
171 (pos) = css_next_descendant_pre((pos), (css)))
172
173/**
174 * css_for_each_descendant_post - post-order walk of a css's descendants
175 * @pos: the css * to use as the loop cursor
176 * @css: css whose descendants to walk
177 *
178 * Similar to css_for_each_descendant_pre() but performs post-order
179 * traversal instead. @root is included in the iteration and the last
180 * node to be visited.
181 *
182 * If a subsystem synchronizes ->css_online() and the start of iteration, a
183 * css which finished ->css_online() is guaranteed to be visible in the
184 * future iterations and will stay visible until the last reference is put.
185 * A css which hasn't finished ->css_online() or already finished
186 * ->css_offline() may show up during traversal. It's each subsystem's
187 * responsibility to synchronize against on/offlining.
188 *
189 * Note that the walk visibility guarantee example described in pre-order
190 * walk doesn't apply the same to post-order walks.
191 */
192#define css_for_each_descendant_post(pos, css) \
193 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
194 (pos) = css_next_descendant_post((pos), (css)))
195
196/**
197 * cgroup_taskset_for_each - iterate cgroup_taskset
198 * @task: the loop cursor
199 * @tset: taskset to iterate
200 */
201#define cgroup_taskset_for_each(task, tset) \
202 for ((task) = cgroup_taskset_first((tset)); (task); \
203 (task) = cgroup_taskset_next((tset)))
32 204
33extern int proc_cgroup_show(struct seq_file *m, struct pid_namespace *ns, 205/*
34 struct pid *pid, struct task_struct *tsk); 206 * Inline functions.
207 */
35 208
36/** 209/**
37 * css_get - obtain a reference on the specified css 210 * css_get - obtain a reference on the specified css
@@ -118,8 +291,87 @@ static inline void css_put_many(struct cgroup_subsys_state *css, unsigned int n)
118 percpu_ref_put_many(&css->refcnt, n); 291 percpu_ref_put_many(&css->refcnt, n);
119} 292}
120 293
121extern struct cgroup_root cgrp_dfl_root; 294/**
122extern struct css_set init_css_set; 295 * task_css_set_check - obtain a task's css_set with extra access conditions
296 * @task: the task to obtain css_set for
297 * @__c: extra condition expression to be passed to rcu_dereference_check()
298 *
299 * A task's css_set is RCU protected, initialized and exited while holding
300 * task_lock(), and can only be modified while holding both cgroup_mutex
301 * and task_lock() while the task is alive. This macro verifies that the
302 * caller is inside proper critical section and returns @task's css_set.
303 *
304 * The caller can also specify additional allowed conditions via @__c, such
305 * as locks used during the cgroup_subsys::attach() methods.
306 */
307#ifdef CONFIG_PROVE_RCU
308extern struct mutex cgroup_mutex;
309extern struct rw_semaphore css_set_rwsem;
310#define task_css_set_check(task, __c) \
311 rcu_dereference_check((task)->cgroups, \
312 lockdep_is_held(&cgroup_mutex) || \
313 lockdep_is_held(&css_set_rwsem) || \
314 ((task)->flags & PF_EXITING) || (__c))
315#else
316#define task_css_set_check(task, __c) \
317 rcu_dereference((task)->cgroups)
318#endif
319
320/**
321 * task_css_check - obtain css for (task, subsys) w/ extra access conds
322 * @task: the target task
323 * @subsys_id: the target subsystem ID
324 * @__c: extra condition expression to be passed to rcu_dereference_check()
325 *
326 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
327 * synchronization rules are the same as task_css_set_check().
328 */
329#define task_css_check(task, subsys_id, __c) \
330 task_css_set_check((task), (__c))->subsys[(subsys_id)]
331
332/**
333 * task_css_set - obtain a task's css_set
334 * @task: the task to obtain css_set for
335 *
336 * See task_css_set_check().
337 */
338static inline struct css_set *task_css_set(struct task_struct *task)
339{
340 return task_css_set_check(task, false);
341}
342
343/**
344 * task_css - obtain css for (task, subsys)
345 * @task: the target task
346 * @subsys_id: the target subsystem ID
347 *
348 * See task_css_check().
349 */
350static inline struct cgroup_subsys_state *task_css(struct task_struct *task,
351 int subsys_id)
352{
353 return task_css_check(task, subsys_id, false);
354}
355
356/**
357 * task_css_is_root - test whether a task belongs to the root css
358 * @task: the target task
359 * @subsys_id: the target subsystem ID
360 *
361 * Test whether @task belongs to the root css on the specified subsystem.
362 * May be invoked in any context.
363 */
364static inline bool task_css_is_root(struct task_struct *task, int subsys_id)
365{
366 return task_css_check(task, subsys_id, true) ==
367 init_css_set.subsys[subsys_id];
368}
369
370static inline struct cgroup *task_cgroup(struct task_struct *task,
371 int subsys_id)
372{
373 return task_css(task, subsys_id)->cgroup;
374}
123 375
124/** 376/**
125 * cgroup_on_dfl - test whether a cgroup is on the default hierarchy 377 * cgroup_on_dfl - test whether a cgroup is on the default hierarchy
@@ -236,284 +488,22 @@ static inline void pr_cont_cgroup_path(struct cgroup *cgrp)
236 pr_cont_kernfs_path(cgrp->kn); 488 pr_cont_kernfs_path(cgrp->kn);
237} 489}
238 490
239char *task_cgroup_path(struct task_struct *task, char *buf, size_t buflen);
240
241int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
242int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
243int cgroup_rm_cftypes(struct cftype *cfts);
244
245bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
246
247struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
248struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
249
250/**
251 * cgroup_taskset_for_each - iterate cgroup_taskset
252 * @task: the loop cursor
253 * @tset: taskset to iterate
254 */
255#define cgroup_taskset_for_each(task, tset) \
256 for ((task) = cgroup_taskset_first((tset)); (task); \
257 (task) = cgroup_taskset_next((tset)))
258
259#define SUBSYS(_x) extern struct cgroup_subsys _x ## _cgrp_subsys;
260#include <linux/cgroup_subsys.h>
261#undef SUBSYS
262
263/**
264 * task_css_set_check - obtain a task's css_set with extra access conditions
265 * @task: the task to obtain css_set for
266 * @__c: extra condition expression to be passed to rcu_dereference_check()
267 *
268 * A task's css_set is RCU protected, initialized and exited while holding
269 * task_lock(), and can only be modified while holding both cgroup_mutex
270 * and task_lock() while the task is alive. This macro verifies that the
271 * caller is inside proper critical section and returns @task's css_set.
272 *
273 * The caller can also specify additional allowed conditions via @__c, such
274 * as locks used during the cgroup_subsys::attach() methods.
275 */
276#ifdef CONFIG_PROVE_RCU
277extern struct mutex cgroup_mutex;
278extern struct rw_semaphore css_set_rwsem;
279#define task_css_set_check(task, __c) \
280 rcu_dereference_check((task)->cgroups, \
281 lockdep_is_held(&cgroup_mutex) || \
282 lockdep_is_held(&css_set_rwsem) || \
283 ((task)->flags & PF_EXITING) || (__c))
284#else
285#define task_css_set_check(task, __c) \
286 rcu_dereference((task)->cgroups)
287#endif
288
289/**
290 * task_css_check - obtain css for (task, subsys) w/ extra access conds
291 * @task: the target task
292 * @subsys_id: the target subsystem ID
293 * @__c: extra condition expression to be passed to rcu_dereference_check()
294 *
295 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
296 * synchronization rules are the same as task_css_set_check().
297 */
298#define task_css_check(task, subsys_id, __c) \
299 task_css_set_check((task), (__c))->subsys[(subsys_id)]
300
301/**
302 * task_css_set - obtain a task's css_set
303 * @task: the task to obtain css_set for
304 *
305 * See task_css_set_check().
306 */
307static inline struct css_set *task_css_set(struct task_struct *task)
308{
309 return task_css_set_check(task, false);
310}
311
312/**
313 * task_css - obtain css for (task, subsys)
314 * @task: the target task
315 * @subsys_id: the target subsystem ID
316 *
317 * See task_css_check().
318 */
319static inline struct cgroup_subsys_state *task_css(struct task_struct *task,
320 int subsys_id)
321{
322 return task_css_check(task, subsys_id, false);
323}
324
325/**
326 * task_css_is_root - test whether a task belongs to the root css
327 * @task: the target task
328 * @subsys_id: the target subsystem ID
329 *
330 * Test whether @task belongs to the root css on the specified subsystem.
331 * May be invoked in any context.
332 */
333static inline bool task_css_is_root(struct task_struct *task, int subsys_id)
334{
335 return task_css_check(task, subsys_id, true) ==
336 init_css_set.subsys[subsys_id];
337}
338
339static inline struct cgroup *task_cgroup(struct task_struct *task,
340 int subsys_id)
341{
342 return task_css(task, subsys_id)->cgroup;
343}
344
345struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
346 struct cgroup_subsys_state *parent);
347
348struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
349
350/**
351 * css_for_each_child - iterate through children of a css
352 * @pos: the css * to use as the loop cursor
353 * @parent: css whose children to walk
354 *
355 * Walk @parent's children. Must be called under rcu_read_lock().
356 *
357 * If a subsystem synchronizes ->css_online() and the start of iteration, a
358 * css which finished ->css_online() is guaranteed to be visible in the
359 * future iterations and will stay visible until the last reference is put.
360 * A css which hasn't finished ->css_online() or already finished
361 * ->css_offline() may show up during traversal. It's each subsystem's
362 * responsibility to synchronize against on/offlining.
363 *
364 * It is allowed to temporarily drop RCU read lock during iteration. The
365 * caller is responsible for ensuring that @pos remains accessible until
366 * the start of the next iteration by, for example, bumping the css refcnt.
367 */
368#define css_for_each_child(pos, parent) \
369 for ((pos) = css_next_child(NULL, (parent)); (pos); \
370 (pos) = css_next_child((pos), (parent)))
371
372struct cgroup_subsys_state *
373css_next_descendant_pre(struct cgroup_subsys_state *pos,
374 struct cgroup_subsys_state *css);
375
376struct cgroup_subsys_state *
377css_rightmost_descendant(struct cgroup_subsys_state *pos);
378
379/**
380 * css_for_each_descendant_pre - pre-order walk of a css's descendants
381 * @pos: the css * to use as the loop cursor
382 * @root: css whose descendants to walk
383 *
384 * Walk @root's descendants. @root is included in the iteration and the
385 * first node to be visited. Must be called under rcu_read_lock().
386 *
387 * If a subsystem synchronizes ->css_online() and the start of iteration, a
388 * css which finished ->css_online() is guaranteed to be visible in the
389 * future iterations and will stay visible until the last reference is put.
390 * A css which hasn't finished ->css_online() or already finished
391 * ->css_offline() may show up during traversal. It's each subsystem's
392 * responsibility to synchronize against on/offlining.
393 *
394 * For example, the following guarantees that a descendant can't escape
395 * state updates of its ancestors.
396 *
397 * my_online(@css)
398 * {
399 * Lock @css's parent and @css;
400 * Inherit state from the parent;
401 * Unlock both.
402 * }
403 *
404 * my_update_state(@css)
405 * {
406 * css_for_each_descendant_pre(@pos, @css) {
407 * Lock @pos;
408 * if (@pos == @css)
409 * Update @css's state;
410 * else
411 * Verify @pos is alive and inherit state from its parent;
412 * Unlock @pos;
413 * }
414 * }
415 *
416 * As long as the inheriting step, including checking the parent state, is
417 * enclosed inside @pos locking, double-locking the parent isn't necessary
418 * while inheriting. The state update to the parent is guaranteed to be
419 * visible by walking order and, as long as inheriting operations to the
420 * same @pos are atomic to each other, multiple updates racing each other
421 * still result in the correct state. It's guaranateed that at least one
422 * inheritance happens for any css after the latest update to its parent.
423 *
424 * If checking parent's state requires locking the parent, each inheriting
425 * iteration should lock and unlock both @pos->parent and @pos.
426 *
427 * Alternatively, a subsystem may choose to use a single global lock to
428 * synchronize ->css_online() and ->css_offline() against tree-walking
429 * operations.
430 *
431 * It is allowed to temporarily drop RCU read lock during iteration. The
432 * caller is responsible for ensuring that @pos remains accessible until
433 * the start of the next iteration by, for example, bumping the css refcnt.
434 */
435#define css_for_each_descendant_pre(pos, css) \
436 for ((pos) = css_next_descendant_pre(NULL, (css)); (pos); \
437 (pos) = css_next_descendant_pre((pos), (css)))
438
439struct cgroup_subsys_state *
440css_next_descendant_post(struct cgroup_subsys_state *pos,
441 struct cgroup_subsys_state *css);
442
443/**
444 * css_for_each_descendant_post - post-order walk of a css's descendants
445 * @pos: the css * to use as the loop cursor
446 * @css: css whose descendants to walk
447 *
448 * Similar to css_for_each_descendant_pre() but performs post-order
449 * traversal instead. @root is included in the iteration and the last
450 * node to be visited.
451 *
452 * If a subsystem synchronizes ->css_online() and the start of iteration, a
453 * css which finished ->css_online() is guaranteed to be visible in the
454 * future iterations and will stay visible until the last reference is put.
455 * A css which hasn't finished ->css_online() or already finished
456 * ->css_offline() may show up during traversal. It's each subsystem's
457 * responsibility to synchronize against on/offlining.
458 *
459 * Note that the walk visibility guarantee example described in pre-order
460 * walk doesn't apply the same to post-order walks.
461 */
462#define css_for_each_descendant_post(pos, css) \
463 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
464 (pos) = css_next_descendant_post((pos), (css)))
465
466bool css_has_online_children(struct cgroup_subsys_state *css);
467
468/* A css_task_iter should be treated as an opaque object */
469struct css_task_iter {
470 struct cgroup_subsys *ss;
471
472 struct list_head *cset_pos;
473 struct list_head *cset_head;
474
475 struct list_head *task_pos;
476 struct list_head *tasks_head;
477 struct list_head *mg_tasks_head;
478};
479
480void css_task_iter_start(struct cgroup_subsys_state *css,
481 struct css_task_iter *it);
482struct task_struct *css_task_iter_next(struct css_task_iter *it);
483void css_task_iter_end(struct css_task_iter *it);
484
485int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
486int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
487
488struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup,
489 struct cgroup_subsys *ss);
490struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
491 struct cgroup_subsys *ss);
492
493#else /* !CONFIG_CGROUPS */ 491#else /* !CONFIG_CGROUPS */
494 492
495struct cgroup_subsys_state; 493struct cgroup_subsys_state;
496 494
497static inline int cgroup_init_early(void) { return 0; } 495static inline void css_put(struct cgroup_subsys_state *css) {}
498static inline int cgroup_init(void) { return 0; } 496static inline int cgroup_attach_task_all(struct task_struct *from,
497 struct task_struct *t) { return 0; }
498static inline int cgroupstats_build(struct cgroupstats *stats,
499 struct dentry *dentry) { return -EINVAL; }
500
499static inline void cgroup_fork(struct task_struct *p) {} 501static inline void cgroup_fork(struct task_struct *p) {}
500static inline void cgroup_post_fork(struct task_struct *p) {} 502static inline void cgroup_post_fork(struct task_struct *p) {}
501static inline void cgroup_exit(struct task_struct *p) {} 503static inline void cgroup_exit(struct task_struct *p) {}
502 504
503static inline int cgroupstats_build(struct cgroupstats *stats, 505static inline int cgroup_init_early(void) { return 0; }
504 struct dentry *dentry) 506static inline int cgroup_init(void) { return 0; }
505{
506 return -EINVAL;
507}
508
509static inline void css_put(struct cgroup_subsys_state *css) {}
510
511/* No cgroups - nothing to do */
512static inline int cgroup_attach_task_all(struct task_struct *from,
513 struct task_struct *t)
514{
515 return 0;
516}
517 507
518#endif /* !CONFIG_CGROUPS */ 508#endif /* !CONFIG_CGROUPS */
519 509