diff options
Diffstat (limited to 'kernel/user.c')
-rw-r--r-- | kernel/user.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/kernel/user.c b/kernel/user.c index 9cb6f6403561..e91331c457e2 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
@@ -84,9 +84,6 @@ static struct user_struct *uid_hash_find(uid_t uid, struct hlist_head *hashent) | |||
84 | 84 | ||
85 | #ifdef CONFIG_FAIR_USER_SCHED | 85 | #ifdef CONFIG_FAIR_USER_SCHED |
86 | 86 | ||
87 | static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */ | ||
88 | static DEFINE_MUTEX(uids_mutex); | ||
89 | |||
90 | static void sched_destroy_user(struct user_struct *up) | 87 | static void sched_destroy_user(struct user_struct *up) |
91 | { | 88 | { |
92 | sched_destroy_group(up->tg); | 89 | sched_destroy_group(up->tg); |
@@ -108,6 +105,19 @@ static void sched_switch_user(struct task_struct *p) | |||
108 | sched_move_task(p); | 105 | sched_move_task(p); |
109 | } | 106 | } |
110 | 107 | ||
108 | #else /* CONFIG_FAIR_USER_SCHED */ | ||
109 | |||
110 | static void sched_destroy_user(struct user_struct *up) { } | ||
111 | static int sched_create_user(struct user_struct *up) { return 0; } | ||
112 | static void sched_switch_user(struct task_struct *p) { } | ||
113 | |||
114 | #endif /* CONFIG_FAIR_USER_SCHED */ | ||
115 | |||
116 | #if defined(CONFIG_FAIR_USER_SCHED) && defined(CONFIG_SYSFS) | ||
117 | |||
118 | static struct kobject uids_kobject; /* represents /sys/kernel/uids directory */ | ||
119 | static DEFINE_MUTEX(uids_mutex); | ||
120 | |||
111 | static inline void uids_mutex_lock(void) | 121 | static inline void uids_mutex_lock(void) |
112 | { | 122 | { |
113 | mutex_lock(&uids_mutex); | 123 | mutex_lock(&uids_mutex); |
@@ -254,11 +264,8 @@ static inline void free_user(struct user_struct *up, unsigned long flags) | |||
254 | schedule_work(&up->work); | 264 | schedule_work(&up->work); |
255 | } | 265 | } |
256 | 266 | ||
257 | #else /* CONFIG_FAIR_USER_SCHED */ | 267 | #else /* CONFIG_FAIR_USER_SCHED && CONFIG_SYSFS */ |
258 | 268 | ||
259 | static void sched_destroy_user(struct user_struct *up) { } | ||
260 | static int sched_create_user(struct user_struct *up) { return 0; } | ||
261 | static void sched_switch_user(struct task_struct *p) { } | ||
262 | static inline int user_kobject_create(struct user_struct *up) { return 0; } | 269 | static inline int user_kobject_create(struct user_struct *up) { return 0; } |
263 | static inline void uids_mutex_lock(void) { } | 270 | static inline void uids_mutex_lock(void) { } |
264 | static inline void uids_mutex_unlock(void) { } | 271 | static inline void uids_mutex_unlock(void) { } |
@@ -277,7 +284,7 @@ static inline void free_user(struct user_struct *up, unsigned long flags) | |||
277 | kmem_cache_free(uid_cachep, up); | 284 | kmem_cache_free(uid_cachep, up); |
278 | } | 285 | } |
279 | 286 | ||
280 | #endif /* CONFIG_FAIR_USER_SCHED */ | 287 | #endif |
281 | 288 | ||
282 | /* | 289 | /* |
283 | * Locate the user_struct for the passed UID. If found, take a ref on it. The | 290 | * Locate the user_struct for the passed UID. If found, take a ref on it. The |