| Mike Galbraith | 5091faa | 2010-11-30 14:18:03 +0100 | [diff] [blame] | 1 | #ifdef CONFIG_SCHED_AUTOGROUP | 
|  | 2 |  | 
|  | 3 | struct autogroup { | 
| Yong Zhang | 800d4d3 | 2011-02-20 15:08:14 +0800 | [diff] [blame] | 4 | /* | 
|  | 5 | * reference doesn't mean how many thread attach to this | 
|  | 6 | * autogroup now. It just stands for the number of task | 
|  | 7 | * could use this autogroup. | 
|  | 8 | */ | 
| Mike Galbraith | 5091faa | 2010-11-30 14:18:03 +0100 | [diff] [blame] | 9 | struct kref		kref; | 
|  | 10 | struct task_group	*tg; | 
|  | 11 | struct rw_semaphore	lock; | 
|  | 12 | unsigned long		id; | 
|  | 13 | int			nice; | 
|  | 14 | }; | 
|  | 15 |  | 
| Yong Zhang | 1c09ab0 | 2011-06-28 10:51:31 +0800 | [diff] [blame] | 16 | static inline bool task_group_is_autogroup(struct task_group *tg); | 
| Mike Galbraith | 5091faa | 2010-11-30 14:18:03 +0100 | [diff] [blame] | 17 | static inline struct task_group * | 
|  | 18 | autogroup_task_group(struct task_struct *p, struct task_group *tg); | 
|  | 19 |  | 
|  | 20 | #else /* !CONFIG_SCHED_AUTOGROUP */ | 
|  | 21 |  | 
|  | 22 | static inline void autogroup_init(struct task_struct *init_task) {  } | 
|  | 23 | static inline void autogroup_free(struct task_group *tg) { } | 
| Mike Galbraith | f449377 | 2011-01-13 04:54:50 +0100 | [diff] [blame] | 24 | static inline bool task_group_is_autogroup(struct task_group *tg) | 
|  | 25 | { | 
|  | 26 | return 0; | 
|  | 27 | } | 
| Mike Galbraith | 5091faa | 2010-11-30 14:18:03 +0100 | [diff] [blame] | 28 |  | 
|  | 29 | static inline struct task_group * | 
|  | 30 | autogroup_task_group(struct task_struct *p, struct task_group *tg) | 
|  | 31 | { | 
|  | 32 | return tg; | 
|  | 33 | } | 
|  | 34 |  | 
|  | 35 | #ifdef CONFIG_SCHED_DEBUG | 
|  | 36 | static inline int autogroup_path(struct task_group *tg, char *buf, int buflen) | 
|  | 37 | { | 
|  | 38 | return 0; | 
|  | 39 | } | 
|  | 40 | #endif | 
|  | 41 |  | 
|  | 42 | #endif /* CONFIG_SCHED_AUTOGROUP */ |