aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-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