aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2007-10-17 10:55:11 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-17 10:55:11 -0400
commitb1a8c172c318534b96d0f0f1aecdad3898118b98 (patch)
treef42b724f02be6f4959e2edcb29687fd5bc54ca69 /kernel/user.c
parent908a7c1b9b80d06708177432020c80d147754691 (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>
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/kernel/user.c b/kernel/user.c
index f0e561e6d085..7e8215d87b40 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
90static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */
91static DEFINE_MUTEX(uids_mutex);
92
93static void sched_destroy_user(struct user_struct *up) 90static 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
113static void sched_destroy_user(struct user_struct *up) { }
114static int sched_create_user(struct user_struct *up) { return 0; }
115static 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
121static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */
122static DEFINE_MUTEX(uids_mutex);
123
114static inline void uids_mutex_lock(void) 124static 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
262static void sched_destroy_user(struct user_struct *up) { }
263static int sched_create_user(struct user_struct *up) { return 0; }
264static void sched_switch_user(struct task_struct *p) { }
265static inline int user_kobject_create(struct user_struct *up) { return 0; } 272static inline int user_kobject_create(struct user_struct *up) { return 0; }
266static inline void uids_mutex_lock(void) { } 273static inline void uids_mutex_lock(void) { }
267static inline void uids_mutex_unlock(void) { } 274static 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