hal/hald/linux block_class_device.c,1.63,1.64

Kay Sievers kay at freedesktop.org
Sat Aug 28 04:18:36 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv30133/hald/linux

Modified Files:
	block_class_device.c 
Log Message:
2004-08-28  Kay Sievers  <kay.sievers at vrfy.org>

        * hald/linux/block_class_device.c:
        (get_first_valid_partition), (detect_media): Fix leftover from
        volume_id name change, which broke no_partitions media.
        Clarify comments only a few lines apart, to not claim the direct
        opposite



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- block_class_device.c	27 Aug 2004 00:24:33 -0000	1.63
+++ block_class_device.c	28 Aug 2004 11:18:34 -0000	1.64
@@ -540,7 +540,7 @@
 				continue;
 
 			if (volume_id_probe(p, VOLUME_ID_ALL, off, 0) == 0 &&
-			    p->type_id == VOLUME_ID_FILESYSTEM)
+			    p->usage_id == VOLUME_ID_FILESYSTEM)
 				return p;
 		}
 	}
@@ -966,7 +966,7 @@
 			
 			if (volume_id_probe (vid, VOLUME_ID_ALL, 0, 0) != 0) {
 				if (is_cdrom) {
-					/* volume_id cannot yet probe blank/audio discs etc,
+					/* volume_id cannot probe blank/audio discs etc,
 					 * so don't fail for them, just set vid to NULL */
 					volume_id_close (vid);
 					vid = NULL;
@@ -979,11 +979,11 @@
 			}
 		}
 
-		/* In Linux, optical discs never have partition
-		 * tables; at least Linux doesn't use it.. This is
-		 * especially true for blank discs, audio discs
-		 * etc. */
-		no_partitions = is_cdrom || (vid != NULL && vid->type_id == VOLUME_ID_FILESYSTEM);
+		/* Unfortunally, linux doesn't scan optical discs for partition
+		 * tables. We only get the main device, the kernel doesn't
+		 * create childs for us.
+		 */
+		no_partitions = is_cdrom || (vid != NULL && vid->usage_id == VOLUME_ID_FILESYSTEM);
 		hal_device_property_set_bool (d, "block.no_partitions", no_partitions);
 
 		if (!no_partitions) {
@@ -999,11 +999,8 @@
 		hal_device_store_add (hald_get_tdl (), child);
 		g_object_unref (child);
 
-		/* Set the stuff we obtained from volume_id
-		 *
-		 * if we detect a partition table like a apple hfs cd, we just
-		 * stop at the first partiton with a valid filesystem and add
-		 * it as a child as the linux kernel doesn't create childs for us
+		/* If _we_ detect a partition table like a apple hfs cd, we just
+		 * stop at the first partiton with a valid filesystem
 		 */
 		if (vid != NULL) {
 			if (vid->partition_count > 0) {
@@ -1018,7 +1015,7 @@
 				set_volume_id_values(child, vid);
 			}
 		}
-			
+
 		/* set UDI (will scan .fdi files and merge from unplugged) */
 		rename_and_merge (child, block_class_compute_udi, "volume");
 




More information about the hal-commit mailing list