[PATCH] Reduce number of KOBJ_REMOVE events

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

 



Author: Zdenek Kabelac <zkabelac@xxxxxxxxxx>
Date:   Fri Jul 22 15:02:17 2011 +0200

Reduce number of KOBJ_REMOVE events

For now udev recieves 3 event for removal of DM logical volumes. (1 for
bdi and 2 for same block kobject). Reason is dm device generates its
own kobject event with approriate env parameter and block layer sends
another KOBJ_REMOVE event on its own unconditionaly for the same
kobject. As for now only the kobject cleanup checks that the REMOVE
event has been already sent and avoids duplicate REMOVE event.

The patch for kobject_uevent_env() which has been testing for duplicate
REMOVE event did not passed into the mainline (yet?):

https://www.redhat.com/archives/dm-devel/2010-March/msg00107.html 

I'm proposing alternative way around to always use kobject cleanup
routine for sending REMOVE event if it was not send by the module - so
it makes the code few lines shorter.

This patch removes single appearencies of kobject_uevent() prior
kobject removal.

Signed-off-by:  Zdenek Kabelac <zkabelac@xxxxxxxxxx>

diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 129b9e2..431f401 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -439,7 +439,6 @@ void blk_integrity_unregister(struct gendisk *disk)
 
 	bi = disk->integrity;
 
-	kobject_uevent(&bi->kobj, KOBJ_REMOVE);
 	kobject_del(&bi->kobj);
 	kobject_put(&bi->kobj);
 	disk->integrity = NULL;
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index d935bd8..a50472d 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -521,7 +521,6 @@ int blk_register_queue(struct gendisk *disk)
 
 	ret = elv_register_queue(q);
 	if (ret) {
-		kobject_uevent(&q->kobj, KOBJ_REMOVE);
 		kobject_del(&q->kobj);
 		blk_trace_remove_sysfs(dev);
 		kobject_put(&dev->kobj);
@@ -541,7 +540,6 @@ void blk_unregister_queue(struct gendisk *disk)
 	if (q->request_fn)
 		elv_unregister_queue(q);
 
-	kobject_uevent(&q->kobj, KOBJ_REMOVE);
 	kobject_del(&q->kobj);
 	blk_trace_remove_sysfs(disk_to_dev(disk));
 	kobject_put(&disk_to_dev(disk)->kobj);
diff --git a/block/elevator.c b/block/elevator.c
index b0b38ce..a8d912b 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -892,7 +892,6 @@ EXPORT_SYMBOL(elv_register_queue);
 
 static void __elv_unregister_queue(struct elevator_queue *e)
 {
-	kobject_uevent(&e->kobj, KOBJ_REMOVE);
 	kobject_del(&e->kobj);
 	e->registered = 0;
 }
diff --git a/drivers/base/core.c b/drivers/base/core.c
index bc8729d..8c9af0d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1013,7 +1013,6 @@ done:
  ueventattrError:
 	device_remove_file(dev, &uevent_attr);
  attrError:
-	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
 	kobject_del(&dev->kobj);
  Error:
 	cleanup_device_parent(dev);
@@ -1132,7 +1131,6 @@ void device_del(struct device *dev)
 	 */
 	if (platform_notify_remove)
 		platform_notify_remove(dev);
-	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
 	cleanup_device_parent(dev);
 	kobject_del(&dev->kobj);
 	put_device(parent);
diff --git a/mm/slub.c b/mm/slub.c
index 35f351f..3c77956 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4720,7 +4720,6 @@ static void sysfs_slab_remove(struct kmem_cache *s)
 		 */
 		return;
 
-	kobject_uevent(&s->kobj, KOBJ_REMOVE);
 	kobject_del(&s->kobj);
 	kobject_put(&s->kobj);
 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 1bacca4..f20a945 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -153,7 +153,6 @@ static void del_nbp(struct net_bridge_port *p)
 
 	br_multicast_del_port(p);
 
-	kobject_uevent(&p->kobj, KOBJ_REMOVE);
 	kobject_del(&p->kobj);
 
 	br_netpoll_disable(p);
--
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