296 remove_user = 1;
297 spin_unlock_irqrestore(&uidhash_lock, flags);
298 } else {
299 local_irq_restore(flags);
300 }
301
302 if (!remove_user)
303 goto done;
304
305 kobject_uevent(&up->kobj, KOBJ_REMOVE);
306 kobject_del(&up->kobj);
307 kobject_put(&up->kobj);
308
309 sched_destroy_user(up);
310 key_put(up->uid_keyring);
311 key_put(up->session_keyring);
312 kmem_cache_free(uid_cachep, up);
313
314done:
315 uids_mutex_unlock();
316}
317
318
319
320
321
322static inline void free_user(struct user_struct *up, unsigned long flags)
323{
324
325 atomic_inc(&up->__count);
326 spin_unlock_irqrestore(&uidhash_lock, flags);
327
328 INIT_WORK(&up->work, remove_user_sysfs_dir);
329 schedule_work(&up->work);
330}
331
332#else
333
334int uids_sysfs_init(void) { return 0; }
335static inline int uids_user_create(struct user_struct *up) { return 0; }
336static inline void uids_mutex_lock(void) { }