diff options
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r-- | lib/kobject_uevent.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 51dc4d287add..b021e67c4294 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, | |||
180 | } | 180 | } |
181 | } | 181 | } |
182 | 182 | ||
183 | /* | ||
184 | * Mark "add" and "remove" events in the object to ensure proper | ||
185 | * events to userspace during automatic cleanup. If the object did | ||
186 | * send an "add" event, "remove" will automatically generated by | ||
187 | * the core, if not already done by the caller. | ||
188 | */ | ||
189 | if (action == KOBJ_ADD) | ||
190 | kobj->state_add_uevent_sent = 1; | ||
191 | else if (action == KOBJ_REMOVE) | ||
192 | kobj->state_remove_uevent_sent = 1; | ||
193 | |||
183 | /* we will send an event, so request a new sequence number */ | 194 | /* we will send an event, so request a new sequence number */ |
184 | spin_lock(&sequence_lock); | 195 | spin_lock(&sequence_lock); |
185 | seq = ++uevent_seqnum; | 196 | seq = ++uevent_seqnum; |