hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sun Aug 6 18:54:38 PDT 2006


 hald/linux2/blockdev.c |  106 -------------------------------------------------
 1 files changed, 106 deletions(-)

New commits:
diff-tree 602bbb270d0851047a0bebc442a1fdc92a4f91c7 (from b573f2a242d12591056a64d293f56c80d8e544ad)
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Aug 6 21:54:07 2006 -0400

    actually remove the ide-cs special handling code

diff --git a/hald/linux2/blockdev.c b/hald/linux2/blockdev.c
index 35e2d0c..1a74b0f 100644
--- a/hald/linux2/blockdev.c
+++ b/hald/linux2/blockdev.c
@@ -1398,112 +1398,6 @@ hotplug_event_begin_remove_blockdev (con
 
 		}
 		
-		
-
-#if 0
-		const char *stor_udi;
-		HalDevice *stor_dev;
-		gboolean is_fakevolume;
-		gboolean is_device_mapper;
-		gboolean is_partition;
-
-		is_partition = hal_device_property_get_bool (d, "volume.is_partition");
-		is_device_mapper = hal_device_property_get_bool (d, "volume.linux.is_device_mapper");
-
-		if (strcmp (hal_util_get_last_element (sysfs_path), "fakevolume") == 0)
-			is_fakevolume = TRUE;
-		else
-			is_fakevolume = FALSE;		
-
-		/* ignore hotplug events on IDE partitions since ide-cs and others causes hotplug 
-		 * rem/add when the last closer (including mount) closes the device. (Unless it's
-		 * a fakevolume)
-		 *
-		 * This causes an infinite loop since we open the device to probe. How nice.
-		 *
-		 * Instead - we'll be removing the partition once the main block device
-		 * goes away
-		 */
-
-		stor_udi = hal_device_property_get_string (d, "block.storage_device");
-		if (is_partition && 
-		    !is_fakevolume &&
-		    stor_udi != NULL && 
-		    ((stor_dev = hal_device_store_find (hald_get_gdl (), stor_udi)) != NULL)) {
-			const char *stor_bus;
-			stor_bus = hal_device_property_get_string (stor_dev, "storage.bus");
-			if (strcmp (stor_bus, "ide") == 0) {
-				/* unless we are already delayed, cf. the code below */
-				if (hal_device_property_get_bool (d, ".already_delayed") != TRUE) {
-					HAL_INFO (("Ignoring hotplug event"));
-					hotplug_event_end (end_token);
-					goto out;
-				}
-			}
-		} else if ((!is_partition) && (!is_device_mapper)) {
-			GSList *i;
-			GSList *partitions;
-			unsigned int num_childs;
-			/* see if there any partitions lying around that we refused to remove above */
-
-			partitions = hal_device_store_match_multiple_key_value_string (hald_get_gdl (),
-										       "block.storage_device",
-										       stor_udi);
-
-			/* have to count number of childs first */
-			num_childs = 0;
-			for (i = partitions; i != NULL; i = g_slist_next (i)) {
-				HalDevice *child;
-				child = HAL_DEVICE (i->data);
-				/* ignore ourself */
-				if (child == d)
-					continue;
-				num_childs++;
-			}
-
-			if (num_childs > 0) {
-
-				/* OK, so we did have childs to remove before removing ourself
-				 *
-				 * Enqueue at front of queue; the childs will get in front of us
-				 * because they will also queue up in front of use (damn kids!)
-				 */
-				HAL_INFO (("Delaying hotplug event until childs are done and gone"));
-				hotplug_event_enqueue_at_front ((HotplugEvent *) end_token);
-				
-				for (i = partitions; i != NULL; i = g_slist_next (i)) {
-					HalDevice *child;
-					HotplugEvent *hotplug_event;
-					child = HAL_DEVICE (i->data);
-					/* ignore ourself */
-					if (child == d)
-						continue;
-
-					/* set a flag such that we *will* get removed above */
-					hal_device_property_set_bool (child, ".already_delayed", TRUE);
-
-					HAL_INFO (("Generating hotplug rem for ignored fakevolume/ide_part with udi %s",
-						   child->udi));
-					/* yay! - gen hotplug event and fast track us to the front of the queue :-) */
-					hotplug_event = blockdev_generate_remove_hotplug_event (child);
-					hotplug_event_enqueue_at_front (hotplug_event);
-				}
-
-				g_slist_free (partitions);
-
-				/* since we pushed ourselves into the queue again above, say that we're done
-				 * but the event shouldn't get deleted
-				 */
-				hotplug_event_reposted (end_token);
-				goto out;
-
-			} else {
-				/* No childs to remove before ourself; just remove ourself, e.g. carry on below */
-				g_slist_free (partitions);
-			}
-		}
-#endif
-
 		/* if we're mounted, then do a lazy unmount so the system can gracefully recover */
 		if (hal_device_property_get_bool (d, "volume.is_mounted")) {
 			force_unmount (d, end_token);



More information about the hal-commit mailing list