hal/hald/linux/volume_id volume_id.c, 1.23, 1.24 volume_id.h, 1.11, 1.12

Kay Sievers kay at freedesktop.org
Fri Aug 20 07:41:49 PDT 2004


Update of /cvs/hal/hal/hald/linux/volume_id
In directory pdx:/home/kay/src/hal/hald/linux/volume_id

Modified Files:
	volume_id.c volume_id.h 
Log Message:
2004-08-19  Kay Sievers  <kay.sievers at vrfy.org>

        * hald/linux/volume_id/volume_id.c: (probe_reiserfs),
	        (probe_swap): Export format_version for reiser and swap



Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- volume_id.c	18 Aug 2004 23:24:42 -0000	1.23
+++ volume_id.c	20 Aug 2004 14:41:47 -0000	1.24
@@ -69,7 +69,7 @@
 			   (((__u64)(x) & 0x000000000000ff00u) << 40) | \
 			   (((__u64)(x) & 0x00000000000000ffu) << 56))
 
-#if (__BYTE_ORDER == __LITTLE_ENDIAN) 
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
 #define le16_to_cpu(x) (x)
 #define le32_to_cpu(x) (x)
 #define le64_to_cpu(x) (x)
@@ -152,7 +152,7 @@
 	memcpy(id->uuid_raw, buf, count);
 
 	/* create string if uuid is set */
-	for (i = 0; i < count; i++) 
+	for (i = 0; i < count; i++)
 		if (buf[i] != 0)
 			goto set;
 	return;
@@ -404,18 +404,25 @@
 	if (rs == NULL)
 		return -1;
 
-	if (strncmp(rs->magic, "ReIsEr2Fs", 9) == 0)
+	if (strncmp(rs->magic, "ReIsEr2Fs", 9) == 0) {
+		strcpy(id->format_version, "3.6");
 		goto found;
-	if (strncmp(rs->magic, "ReIsEr3Fs", 9) == 0)
+	}
+
+	if (strncmp(rs->magic, "ReIsEr3Fs", 9) == 0) {
+		strcpy(id->format_version, "JR");
 		goto found;
+	}
 
 	rs = (struct reiserfs_super_block *)
 	     get_buffer(id, off + REISERFS1_SUPERBLOCK_OFFSET, 0x200);
 	if (rs == NULL)
 		return -1;
 
-	if (strncmp(rs->magic, "ReIsErFs", 8) == 0)
+	if (strncmp(rs->magic, "ReIsErFs", 8) == 0) {
+		strcpy(id->format_version, "3.5");
 		goto found;
+	}
 
 	return -1;
 
@@ -901,7 +908,7 @@
 
 	clen = vd->type.primary.ident.clen;
 	dbg("label string charsize=%i bit", clen);
-	if (clen == 8) 
+	if (clen == 8)
 		set_label_string(id, vd->type.primary.ident.c, 31);
 	else if (clen == 16)
 		set_label_unicode16(id, vd->type.primary.ident.c, BE,31);
@@ -1014,7 +1021,7 @@
 		__u32	fs_fpg;
 		struct ufs_csum {
 			__u32	cs_ndir;
-			__u32	cs_nbfree; 
+			__u32	cs_nbfree;
 			__u32	cs_nifree;
 			__u32	cs_nffree;
 		} __attribute__((__packed__)) fs_cstotal;
@@ -1100,7 +1107,7 @@
 		__u32	fs_magic;
 		__u8	fs_space[1];
 	} __attribute__((__packed__)) *ufs;
-	
+
 	__u32	magic;
 	int 	i;
 	int	offsets[] = {0, 8, 64, 256, -1};
@@ -1141,7 +1148,7 @@
 
 static int probe_mac_partition_map(struct volume_id *id, __u64 off)
 {
-	struct mac_driver_desc { 
+	struct mac_driver_desc {
 		__u8	signature[2];
 		__u16	block_size;
 		__u32	block_count;
@@ -1438,7 +1445,7 @@
 	dbg("descriptor type 0x%x", descr->type);
 	if (descr->type != HFS_NODE_LEAF)
 		goto found;
-	
+
 	key = (struct hfsplus_catalog_key *)
 		&buf[sizeof(struct hfsplus_bnode_descriptor)];
 
@@ -1636,10 +1643,14 @@
 			if (sig == NULL)
 				return -1;
 
-			if (strncmp(sig, "SWAP-SPACE", 10) == 0)
+			if (strncmp(sig, "SWAP-SPACE", 10) == 0) {
+				strcpy(id->format_version, "1");
 				goto found;
-			if (strncmp(sig, "SWAPSPACE2", 10) == 0)
+			}
+			if (strncmp(sig, "SWAPSPACE2", 10) == 0) {
+				strcpy(id->format_version, "2");
 				goto found;
+			}
 	}
 	return -1;
 

Index: volume_id.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- volume_id.h	18 Aug 2004 23:24:42 -0000	1.11
+++ volume_id.h	20 Aug 2004 14:41:47 -0000	1.12
@@ -21,7 +21,7 @@
 #ifndef _VOLUME_ID_H_
 #define _VOLUME_ID_H_
 
-#define VOLUME_ID_VERSION		013
+#define VOLUME_ID_VERSION		014
 
 #define VOLUME_ID_LABEL_SIZE		64
 #define VOLUME_ID_UUID_SIZE		16




More information about the hal-commit mailing list