diff options
Diffstat (limited to 'kernel')
-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 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 | ||
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 |