aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2010-03-05 21:32:31 -0500
committerAlasdair G Kergon <agk@redhat.com>2010-03-05 21:32:31 -0500
commit3abf85b5b5851b5f28d3d8a920ebb844edd08352 (patch)
treeb59e5c9322cc116b0ce5dc183d3b8286080c6031 /drivers/md/dm.c
parenta97f925a32aad2a37971d7bfb657006acf04e42d (diff)
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>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 7199846364e9..d21e1284604f 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2618,18 +2618,19 @@ out:
2618/*----------------------------------------------------------------- 2618/*-----------------------------------------------------------------
2619 * Event notification. 2619 * Event notification.
2620 *---------------------------------------------------------------*/ 2620 *---------------------------------------------------------------*/
2621void dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, 2621int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action,
2622 unsigned cookie) 2622 unsigned cookie)
2623{ 2623{
2624 char udev_cookie[DM_COOKIE_LENGTH]; 2624 char udev_cookie[DM_COOKIE_LENGTH];
2625 char *envp[] = { udev_cookie, NULL }; 2625 char *envp[] = { udev_cookie, NULL };
2626 2626
2627 if (!cookie) 2627 if (!cookie)
2628 kobject_uevent(&disk_to_dev(md->disk)->kobj, action); 2628 return kobject_uevent(&disk_to_dev(md->disk)->kobj, action);
2629 else { 2629 else {
2630 snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u", 2630 snprintf(udev_cookie, DM_COOKIE_LENGTH, "%s=%u",
2631 DM_COOKIE_ENV_VAR_NAME, cookie); 2631 DM_COOKIE_ENV_VAR_NAME, cookie);
2632 kobject_uevent_env(&disk_to_dev(md->disk)->kobj, action, envp); 2632 return kobject_uevent_env(&disk_to_dev(md->disk)->kobj,
2633 action, envp);
2633 } 2634 }
2634} 2635}
2635 2636