sched: generate uevents for user creation/destruction
authorSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Mon, 15 Oct 2007 15:00:18 +0000 (17:00 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 15 Oct 2007 15:00:18 +0000 (17:00 +0200)
Generate uevents when a user is being created/destroyed. These events
can be used to configure cpu share of a new user.

Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/user.c

index 74cadea8466f9e2fffb1651a9e6a348f9aac2b88..f0e561e6d085a8f1a899c85d51c555aa18570d79 100644 (file)
@@ -174,6 +174,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 +191,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 +231,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);