dm ioctl: introduce flag indicating uevent was generated
Set a new DM_UEVENT_GENERATED_FLAG when returning from ioctls to indicate that a uevent was actually generated. This tells the userspace caller that it may need to wait for the event to be processed. Signed-off-by: Peter Rajnoha <prajnoha@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:

zatwierdzone przez
Alasdair G Kergon

rodzic
a97f925a32
commit
3abf85b5b5
@@ -2618,18 +2618,19 @@ out:
|
||||
/*-----------------------------------------------------------------
|
||||
* Event notification.
|
||||
*---------------------------------------------------------------*/
|
||||
void dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
|
||||
int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
|
||||
unsigned cookie)
|
||||
{
|
||||
char udev_cookie[DM_COOKIE_LENGTH];
|
||||
char *envp[] = { udev_cookie, NULL };
|
||||
|
||||
if (!cookie)
|
||||
kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
|
||||
return kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
|
||||
else {
|
||||
snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u",
|
||||
DM_COOKIE_ENV_VAR_NAME, cookie);
|
||||
kobject_uevent_env(&disk_to_dev(md->disk)->kobj, action, envp);
|
||||
return kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
|
||||
action, envp);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user