[Kernel PATCH] emit change on devmapper devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-- 
Scott James Remnant
scott@xxxxxxxxxx
diff -ruNp linux-source-2.6.22~/drivers/md/dm-ioctl.c linux-source-2.6.22/drivers/md/dm-ioctl.c
--- linux-source-2.6.22~/drivers/md/dm-ioctl.c	2007-07-10 17:54:44.000000000 +0100
+++ linux-source-2.6.22/drivers/md/dm-ioctl.c	2007-07-10 22:01:09.000000000 +0100
@@ -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.
 	 */
diff -ruNp linux-source-2.6.22~/drivers/md/dm.c linux-source-2.6.22/drivers/md/dm.c
--- linux-source-2.6.22~/drivers/md/dm.c	2007-05-13 19:55:50.000000000 +0100
+++ linux-source-2.6.22/drivers/md/dm.c	2007-07-10 22:01:09.000000000 +0100
@@ -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,
diff -ruNp linux-source-2.6.22~/drivers/md/dm.h linux-source-2.6.22/drivers/md/dm.h
--- linux-source-2.6.22~/drivers/md/dm.h	2007-05-13 19:55:50.000000000 +0100
+++ linux-source-2.6.22/drivers/md/dm.h	2007-07-10 22:01:09.000000000 +0100
@@ -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

Attachment: signature.asc
Description: This is a digitally signed message part

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux