hal/hald/linux/volume_id volume_id.c, 1.28, 1.29 volume_id.h, 1.16, 1.17 volume_id_logging.h, NONE, 1.1

Kay Sievers kay at freedesktop.org
Mon Aug 30 08:13:19 PDT 2004


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

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

        * hald/linux/volume_id/volume_id.c: (probe_linux_raid): Skip very
        very small volumes, caus our end of volume calculation is wrong in
        that case.

        * hald/linux/volume_id/volume_id_logging.h: Add a new file
        to wrap the HAL logging facility into volume_id



Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- volume_id.c	27 Aug 2004 00:24:33 -0000	1.28
+++ volume_id.c	30 Aug 2004 15:13:17 -0000	1.29
@@ -24,7 +24,7 @@
  */
 
 #ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -42,15 +42,7 @@
 #include <asm/types.h>
 
 #include "volume_id.h"
-
-#ifdef DEBUG
-#define dbg(format, arg...)						\
-	do {								\
-		printf("%s: " format "\n", __FUNCTION__ , ## arg);	\
-	} while (0)
-#else
-#define dbg(format, arg...)	do {} while (0)
-#endif /* DEBUG */
+#include "volume_id_logging.h"
 
 #define bswap16(x) (__u16)((((__u16)(x) & 0x00ffu) << 8) | \
 			   (((__u32)(x) & 0xff00u) >> 8))
@@ -337,12 +329,13 @@
 	} __attribute__((packed)) *mdp;
 
 	const __u8 *buf;
-	__u64 sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
+	__u64 sboff;
 	__u8 uuid[16];
 
-	if (size == 0)
+	if (size < 0x10000)
 		return -1;
 
+	sboff = (size & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES;
 	buf = get_buffer(id, off + sboff, 0x800);
 	if (buf == NULL)
 		return -1;

Index: volume_id.h
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- volume_id.h	27 Aug 2004 00:24:33 -0000	1.16
+++ volume_id.h	30 Aug 2004 15:13:17 -0000	1.17
@@ -21,7 +21,7 @@
 #ifndef _VOLUME_ID_H_
 #define _VOLUME_ID_H_
 
-#define VOLUME_ID_VERSION		021
+#define VOLUME_ID_VERSION		022
 
 #define VOLUME_ID_LABEL_SIZE		64
 #define VOLUME_ID_UUID_SIZE		16

--- NEW FILE: volume_id_logging.h ---
/*
 * volume_id_logging - this file is used to map the dbg() function
 *                     to the host logging facility
 *
 */

#ifndef _VOLUME_ID_LOGGING_H_
#define _VOLUME_ID_LOGGING_H_

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "../../logger.h"
#define dbg(s...)	HAL_INFO((s))

#endif /* _VOLUME_ID_LOGGING_H_ */




More information about the hal-commit mailing list