All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott James Remnant <scott@ubuntu.com>
To: linux-hotplug-devel@lists.sourceforge.net
Cc: dm-devel@redhat.com
Subject: [Kernel PATCH] emit change on devmapper devices
Date: Wed, 07 Nov 2007 11:50:07 -0500	[thread overview]
Message-ID: <1194454207.6273.5.camel@wing-commander> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 421 bytes --]

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@ubuntu.com

[-- Attachment #1.1.2: Type: text/x-patch, Size: 1524 bytes --]

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 #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
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/

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

WARNING: multiple messages have this Message-ID (diff)
From: Scott James Remnant <scott@ubuntu.com>
To: linux-hotplug-devel@lists.sourceforge.net
Cc: dm-devel@redhat.com
Subject: [Kernel PATCH] emit change on devmapper devices
Date: Wed, 07 Nov 2007 16:50:07 +0000	[thread overview]
Message-ID: <1194454207.6273.5.camel@wing-commander> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 421 bytes --]

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@ubuntu.com

[-- Attachment #1.1.2: Type: text/x-patch, Size: 1524 bytes --]

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 #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
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/

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

             reply	other threads:[~2007-11-07 16:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 16:50 Scott James Remnant [this message]
2007-11-07 16:50 ` [Kernel PATCH] emit change on devmapper devices Scott James Remnant
2007-11-07 17:18 ` Linas Vepstas
2007-11-07 17:18   ` Linas Vepstas
2007-11-12 21:20 ` Phillip Susi
2007-11-12 21:20   ` [dm-devel] " Phillip Susi
2007-11-12 21:34   ` Alasdair G Kergon
2007-11-12 21:34     ` [dm-devel] " Alasdair G Kergon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194454207.6273.5.camel@wing-commander \
    --to=scott@ubuntu.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-hotplug-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.