Skip to content

Commit

Permalink
[PATCH] device-mapper ioctl: event on rename
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
goggin, edward authored and Linus Torvalds committed Jan 6, 2006
1 parent d229a95 commit 81f1777
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 81f1777

Please sign in to comment.