summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
authorgoggin, edward <egoggin@emc.com>2006-01-06 09:20:01 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 17:34:00 +0100
commit81f1777a55e8c631b61e5fa5980fb7a2004287af (patch)
treee63c43ce8951e316f21a85554d867dd25a2ceb6c /drivers/md/dm-ioctl.c
parent[PATCH] device-mapper: add dm_get_md (diff)
downloadlinux-81f1777a55e8c631b61e5fa5980fb7a2004287af.tar.xz
linux-81f1777a55e8c631b61e5fa5980fb7a2004287af.zip
[PATCH] device-mapper ioctl: event on rename
After changing the name of a mapped device, trigger a dm event. (For userspace multipath tools.) Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--drivers/md/dm-ioctl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 07d44e19536e..3e327db57310 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -270,6 +270,7 @@ static int dm_hash_rename(const char *old, const char *new)
{
char *new_name, *old_name;
struct hash_cell *hc;
+ struct dm_table *table;
/*
* duplicate new.
@@ -317,6 +318,15 @@ static int dm_hash_rename(const char *old, const char *new)
/* rename the device node in devfs */
register_with_devfs(hc);
+ /*
+ * Wake up any dm event waiters.
+ */
+ table = dm_get_table(hc->md);
+ if (table) {
+ dm_table_event(table);
+ dm_table_put(table);
+ }
+
up_write(&_hash_lock);
kfree(old_name);
return 0;