Skip to contentSkip to conversation

emit change on devmapper devices

PATCH In review Scott James Remnant 4 participants 4 messages Nov 7, 2007 – Nov 12, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 emit change on devmapper devices

Hi guys,

I've had this patch sitting on my disk for a few months, and haven't done anything more than test it. Before I stuff it into git, and send it to the kernel, would you guys have a look over it and see whether it's technically correct.

The patch simply causes a kobject "change" event to be emitted on devmapper block devices when they are renamed.

Scott

Signature · 2 lines
Scott James Remnant
[email protected]
drivers/md/dm-ioctl.c +2 -0
diff -ruNp linux-source-2.6.22~/drivers/md/dm-ioctl.c linux-source-2.6.22/drivers/md/dm-ioctl.c
@@ -323,6 +323,8 @@ static int dm_hash_rename(const char *ol
 	hc->name = new_name;
 	list_add(&hc->name_list, _name_buckets + hash_str(new_name));
 
+	dm_changed(hc->md);
+
 	/*
 	 * Wake up any dm event waiters.
 	 */
drivers/md/dm.c +5 -0
diff -ruNp linux-source-2.6.22~/drivers/md/dm.c linux-source-2.6.22/drivers/md/dm.c
@@ -1542,6 +1542,11 @@ int dm_noflush_suspending(struct dm_targ
 }
 EXPORT_SYMBOL_GPL(dm_noflush_suspending);
 
+void dm_changed(struct mapped_device *md)
+{
+	kobject_uevent(&md->disk->kobj, KOBJ_CHANGE);
+}
+
 static struct block_device_operations dm_blk_dops = {
 	.open = dm_blk_open,
 	.release = dm_blk_close,
drivers/md/dm.h +2 -0
diff -ruNp linux-source-2.6.22~/drivers/md/dm.h linux-source-2.6.22/drivers/md/dm.h
@@ -151,4 +151,6 @@ union map_info *dm_get_mapinfo(struct bi
 int dm_open_count(struct mapped_device *md);
 int dm_lock_for_deletion(struct mapped_device *md);
 
+void dm_changed(struct mapped_device *md);
+
 #endif

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 3 lines · Scott James Remnant

Hi guys,

I've had this patch sitting on my disk for a few months, and haven't

....

On my email reader, I see the following:

[-- PGP output follows (current time: Wed 07 Nov 2007 11:16:06 AM CST) --]
gpg: Signature made Wed 07 Nov 2007 10:50:07 AM CST using DSA key ID C978C8AE
gpg: BAD signature from "Scott James Remnant <[email protected]>" [-- End of PGP output --]

I've never seen a bad signature before ... I thought that was weird.

--linas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

#2 lore raw
In reply to Scott James Remnant
Quoted 9 lines · Scott James Remnant

Hi guys,

I've had this patch sitting on my disk for a few months, and haven't done anything more than test it. Before I stuff it into git, and send it to the kernel, would you guys have a look over it and see whether it's technically correct.

The patch simply causes a kobject "change" event to be emitted on devmapper block devices when they are renamed.

When they are renamed? Don't you want a change event when you modify the table?

#3 lore raw
Quoted 2 lines · Phillip Susi

When they are renamed? Don't you want a change event when you modify the table?

Yes of course - the code already has that, but rename avoids that code path.

Alasdair

Signature · 1 line
[email protected]