X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fkobject_uevent.c;h=5a402e2982afb4a1a82a28092260bb66bd921269;hb=66c6ceae39534c029c3434489c036f5ae2c6a593;hp=51dc4d287addf9846b6c4b13ddc8c38ca4692bf4;hpb=9f66fa2a4690a16da0dbaae2f44ddfc313802504;p=linux-2.6-omap-h63xx.git diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 51dc4d287ad..5a402e2982a 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -180,6 +180,17 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, } } + /* + * Mark "add" and "remove" events in the object to ensure proper + * events to userspace during automatic cleanup. If the object did + * send an "add" event, "remove" will automatically generated by + * the core, if not already done by the caller. + */ + if (action == KOBJ_ADD) + kobj->state_add_uevent_sent = 1; + else if (action == KOBJ_REMOVE) + kobj->state_remove_uevent_sent = 1; + /* we will send an event, so request a new sequence number */ spin_lock(&sequence_lock); seq = ++uevent_seqnum; @@ -227,11 +238,12 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, retval = add_uevent_var(env, "HOME=/"); if (retval) goto exit; - retval = add_uevent_var(env, "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); + retval = add_uevent_var(env, + "PATH=/sbin:/bin:/usr/sbin:/usr/bin"); if (retval) goto exit; - call_usermodehelper (argv[0], argv, env->envp, UMH_WAIT_EXEC); + call_usermodehelper(argv[0], argv, env->envp, UMH_WAIT_EXEC); } exit: @@ -239,7 +251,6 @@ exit: kfree(env); return retval; } - EXPORT_SYMBOL_GPL(kobject_uevent_env); /** @@ -255,7 +266,6 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action) { return kobject_uevent_env(kobj, action, NULL); } - EXPORT_SYMBOL_GPL(kobject_uevent); /**