diff options
author | Dhaval Giani <dhaval@linux.vnet.ibm.com> | 2007-10-17 10:55:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-17 10:55:11 -0400 |
commit | b1a8c172c318534b96d0f0f1aecdad3898118b98 (patch) | |
tree | f42b724f02be6f4959e2edcb29687fd5bc54ca69 | |
parent | 908a7c1b9b80d06708177432020c80d147754691 (diff) |
sched: fix !SYSFS build breakage
When CONFIG_SYSFS is not set, CONFIG_FAIR_USER_SCHED fails to build
with
kernel/built-in.o: In function `uids_kobject_init':
(.init.text+0x1488): undefined reference to `kernel_subsys'
kernel/built-in.o: In function `uids_kobject_init':
(.init.text+0x1490): undefined reference to `kernel_subsys'
kernel/built-in.o: In function `uids_kobject_init':
(.init.text+0x1480): undefined reference to `kernel_subsys'
kernel/built-in.o: In function `uids_kobject_init':
(.init.text+0x1494): undefined reference to `kernel_subsys'
This patch fixes this build error.
Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | kernel/user.c | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 592e3a55f81..4ac7d51ad0e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -530,10 +530,12 @@ struct user_struct { | |||
530 | 530 | ||
531 | #ifdef CONFIG_FAIR_USER_SCHED | 531 | #ifdef CONFIG_FAIR_USER_SCHED |
532 | struct task_group *tg; | 532 | struct task_group *tg; |
533 | #ifdef CONFIG_SYSFS | ||
533 | struct kset kset; | 534 | struct kset kset; |
534 | struct subsys_attribute user_attr; | 535 | struct subsys_attribute user_attr; |
535 | struct work_struct work; | 536 | struct work_struct work; |
536 | #endif | 537 | #endif |
538 | #endif | ||
537 | }; | 539 | }; |
538 | 540 | ||
539 | #ifdef CONFIG_FAIR_USER_SCHED | 541 | #ifdef CONFIG_FAIR_USER_SCHED |
diff --git a/kernel/user.c b/kernel/user.c index f0e561e6d08..7e8215d87b4 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
@@ -87,9 +87,6 @@ static inline struct user_struct *uid_hash_find(uid_t uid, | |||
87 | 87 | ||
88 | #ifdef CONFIG_FAIR_USER_SCHED | 88 | #ifdef CONFIG_FAIR_USER_SCHED |
89 | 89 | ||
90 | static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */ | ||
91 | static DEFINE_MUTEX(uids_mutex); | ||
92 | |||
93 | static void sched_destroy_user(struct user_struct *up) | 90 | static void sched_destroy_user(struct user_struct *up) |
94 | { | 91 | { |
95 | sched_destroy_group(up->tg); | 92 | sched_destroy_group(up->tg); |
@@ -111,6 +108,19 @@ static void sched_switch_user(struct task_struct *p) | |||
111 | sched_move_task(p); | 108 | sched_move_task(p); |
112 | } | 109 | } |
113 | 110 | ||
111 | #else /* CONFIG_FAIR_USER_SCHED */ | ||
112 | |||
113 | static void sched_destroy_user(struct user_struct *up) { } | ||
114 | static int sched_create_user(struct user_struct *up) { return 0; } | ||
115 | static void sched_switch_user(struct task_struct *p) { } | ||
116 | |||
117 | #endif /* CONFIG_FAIR_USER_SCHED */ | ||
118 | |||
119 | #if defined(CONFIG_FAIR_USER_SCHED) && defined(CONFIG_SYSFS) | ||
120 | |||
121 | static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */ | ||
122 | static DEFINE_MUTEX(uids_mutex); | ||
123 | |||
114 | static inline void uids_mutex_lock(void) | 124 | static inline void uids_mutex_lock(void) |
115 | { | 125 | { |
116 | mutex_lock(&uids_mutex); | 126 | mutex_lock(&uids_mutex); |
@@ -257,11 +267,8 @@ static inline void free_user(struct user_struct *up, unsigned long flags) | |||
257 | schedule_work(&up->work); | 267 | schedule_work(&up->work); |
258 | } | 268 | } |
259 | 269 | ||
260 | #else /* CONFIG_FAIR_USER_SCHED */ | 270 | #else /* CONFIG_FAIR_USER_SCHED && CONFIG_SYSFS */ |
261 | 271 | ||
262 | static void sched_destroy_user(struct user_struct *up) { } | ||
263 | static int sched_create_user(struct user_struct *up) { return 0; } | ||
264 | static void sched_switch_user(struct task_struct *p) { } | ||
265 | static inline int user_kobject_create(struct user_struct *up) { return 0; } | 272 | static inline int user_kobject_create(struct user_struct *up) { return 0; } |
266 | static inline void uids_mutex_lock(void) { } | 273 | static inline void uids_mutex_lock(void) { } |
267 | static inline void uids_mutex_unlock(void) { } | 274 | static inline void uids_mutex_unlock(void) { } |
@@ -280,7 +287,7 @@ static inline void free_user(struct user_struct *up, unsigned long flags) | |||
280 | kmem_cache_free(uid_cachep, up); | 287 | kmem_cache_free(uid_cachep, up); |
281 | } | 288 | } |
282 | 289 | ||
283 | #endif /* CONFIG_FAIR_USER_SCHED */ | 290 | #endif |
284 | 291 | ||
285 | /* | 292 | /* |
286 | * Locate the user_struct for the passed UID. If found, take a ref on it. The | 293 | * Locate the user_struct for the passed UID. If found, take a ref on it. The |