Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[powerpc.git] / kernel / user.c
index 74cadea..9cb6f64 100644 (file)
@@ -44,7 +44,6 @@ struct user_struct root_user = {
        .processes      = ATOMIC_INIT(1),
        .files          = ATOMIC_INIT(0),
        .sigpending     = ATOMIC_INIT(0),
-       .mq_bytes       = 0,
        .locked_shm     = 0,
 #ifdef CONFIG_KEYS
        .uid_keyring    = &root_user_keyring,
@@ -58,19 +57,17 @@ struct user_struct root_user = {
 /*
  * These routines must be called with the uidhash spinlock held!
  */
-static inline void uid_hash_insert(struct user_struct *up,
-                                               struct hlist_head *hashent)
+static void uid_hash_insert(struct user_struct *up, struct hlist_head *hashent)
 {
        hlist_add_head(&up->uidhash_node, hashent);
 }
 
-static inline void uid_hash_remove(struct user_struct *up)
+static void uid_hash_remove(struct user_struct *up)
 {
        hlist_del_init(&up->uidhash_node);
 }
 
-static inline struct user_struct *uid_hash_find(uid_t uid,
-                                               struct hlist_head *hashent)
+static struct user_struct *uid_hash_find(uid_t uid, struct hlist_head *hashent)
 {
        struct user_struct *user;
        struct hlist_node *h;
@@ -174,6 +171,8 @@ static int user_kobject_create(struct user_struct *up)
        if (error)
                kobject_del(kobj);
 
+       kobject_uevent(kobj, KOBJ_ADD);
+
 done:
        return error;
 }
@@ -189,6 +188,7 @@ int __init uids_kobject_init(void)
 
        /* create under /sys/kernel dir */
        uids_kobject.parent = &kernel_subsys.kobj;
+       uids_kobject.kset = &kernel_subsys;
        kobject_set_name(&uids_kobject, "uids");
        kobject_init(&uids_kobject);
 
@@ -228,6 +228,7 @@ static void remove_user_sysfs_dir(struct work_struct *w)
                goto done;
 
        sysfs_remove_file(kobj, &up->user_attr.attr);
+       kobject_uevent(kobj, KOBJ_REMOVE);
        kobject_del(kobj);
 
        sched_destroy_user(up);
@@ -339,8 +340,9 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
                atomic_set(&new->inotify_watches, 0);
                atomic_set(&new->inotify_devs, 0);
 #endif
-
+#ifdef CONFIG_POSIX_MQUEUE
                new->mq_bytes = 0;
+#endif
                new->locked_shm = 0;
 
                if (alloc_uid_keyring(new, current) < 0) {