提交 81f1777a 编写于 作者: G goggin, edward 提交者: Linus Torvalds

[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: NAlasdair G Kergon <agk@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 d229a958
...@@ -270,6 +270,7 @@ static int dm_hash_rename(const char *old, const char *new) ...@@ -270,6 +270,7 @@ static int dm_hash_rename(const char *old, const char *new)
{ {
char *new_name, *old_name; char *new_name, *old_name;
struct hash_cell *hc; struct hash_cell *hc;
struct dm_table *table;
/* /*
* duplicate new. * duplicate new.
...@@ -317,6 +318,15 @@ static int dm_hash_rename(const char *old, const char *new) ...@@ -317,6 +318,15 @@ static int dm_hash_rename(const char *old, const char *new)
/* rename the device node in devfs */ /* rename the device node in devfs */
register_with_devfs(hc); 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); up_write(&_hash_lock);
kfree(old_name); kfree(old_name);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册