Changes by: jkemi
Update of /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions
In directory usw-pr-cvs1:/tmp/cvs-serv6089
Modified Files:
ldm.c ldm_md.c
Log Message:
ldm_md.c fix
Index: ldm.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -U2 -r1.62 -r1.63
--- ldm.c 27 Feb 2002 16:03:58 -0000 1.62
+++ ldm.c 27 Feb 2002 17:40:20 -0000 1.63
@@ -31,5 +31,5 @@
#ifdef CONFIG_LDM_EXPORT_SYMBOLS
-#define static
+# define static
#endif
@@ -42,5 +42,5 @@
u8 n, u8 parts, u8 chunk_s, kdev_t dev);
#else
-# define ldm_md_addpart(a...) do {} while (0)
+# define ldm_md_addpart(...) do {} while (0)
#endif
@@ -60,5 +60,5 @@
#ifndef CONFIG_LDM_DEBUG
-# define ldm_debug(f, a...) do {} while (0)
+# define ldm_debug(...) do {} while (0)
# define DEBUG_ON(x) do {} while (0)
#else
@@ -97,5 +97,5 @@
level = LDM_LVL_NONE;
- printk("%s(%s) (%s @ %d): %s(): %s", prefix[level], label[level],
+ printk("%s(%s) (%s, %d) %s(): %s", prefix[level], label[level],
file, line, function, buf);
}
@@ -153,5 +153,5 @@
return TRUE;
}
-// FIXME: Why doesn't this work ??
+// FIXME: Why doesn't this work ??
/*
static BOOL ldm_parse_guid (const u8 *src, u8 *dest)
Index: ldm_md.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm_md.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- ldm_md.c 9 Feb 2002 18:52:40 -0000 1.5
+++ ldm_md.c 27 Feb 2002 17:40:20 -0000 1.6
@@ -47,31 +47,33 @@
//#define LDM_MD_DEBUG
-#define LDM_MD_MSG_NOMEM "out of memory!\n"
-#define LDM_MD_MSG_CORRUPT "volume data seems inconsistent, bailing out!\n"
+#define LDM_MD_MSG_NOMEM "Out of memory.\n"
+#define LDM_MD_MSG_CORRUPT "Volume data seems inconsistent, bailing out.\n"
// Debug messages
#ifdef LDM_MD_DEBUG
-#define ldm_debug(f, a...) \
- do { \
- printk (KERN_DEBUG "ldm_md %s() @ line %d (DEBUG): ", \
- __FUNCTION__, __LINE__); \
- printk (f, ##a); \
+# define ldm_debug(f, a...) \
+ do { \
+ printk ("%s(ldm_md.c, %d) (DEBUG) %s(): ", \
+ KERN_DEBUG, __LINE__, __func__); \
+ printk (f, ##a); \
} while (0)
#else
-#define ldm_debug(f, a...) do {} while (0)
+# define ldm_debug(...) do {} while (0)
#endif
// Warning messages
-#define ldm_warn(f, a...) \
- do { \
- printk (KERN_WARNING "ldm_md (WARNING): "); \
- printk (f, ##a); \
+#define ldm_warn(f, a...) \
+ do { \
+ printk ("%s(ldm_md.c, %d) (WARNING): %s(): ", \
+ KERN_WARNING, __LINE__, __func__); \
+ printk (f, ##a); \
} while (0)
// Error messages
-#define ldm_err(f, a...) \
- do { \
- printk (KERN_ERR "ldm_md (ERROR): "); \
- printk (f, ##a); \
+#define ldm_err(f, a...) \
+ do { \
+ printk ("%s(ldm_md.c, %d) (ERROR): %s(): ", \
+ KERN_ERR, __LINE__, __func__); \
+ printk (f, ##a); \
} while(0)
@@ -110,6 +112,6 @@
* the initial values. The struct is also added to the volumelist (_vols)
*
- * Return: Pointer Success
- * 0 Error
+ * Return: ptr Success
+ * 0 Error
*/
static _ldm_md_t* _ldm_md_create(const u8* dg_guid, u32 objid,
@@ -160,6 +162,6 @@
* Otherwise the entry is created.
*
- * Return: Pointer Success
- * 0 Error
+ * Return: ptr Success
+ * 0 Error
*/
static _ldm_md_t* _ldm_md_get(const u8* dg_guid, u32 objid,
@@ -180,5 +182,5 @@
return 0;
}
-
+
ldm_debug("id %u t %u n %u !FOUND!\n", objid,
level, parts);
@@ -208,11 +210,10 @@
void ldm_md_destroy(void)
{
- list_t *item;
+ list_t *item, *tmp;
- for(item = _vols.next; item != &_vols; ) {
- _ldm_md_t* v = list_entry(item, _ldm_md_t, list);
- item = item->next;
- kfree(v);
- }
+ list_for_each_safe (item, tmp, &_vols)
+ kfree (list_entry (item, _ldm_md_t, list));
+
+ INIT_LIST_HEAD(&_vols);
}
@@ -274,9 +275,9 @@
void ldm_md_flush(void)
{
- list_t *item;
+ list_t *item, *tmp;
static int minor = CONFIG_LDM_MD_MINOR;
// Scan for complete volumes
- list_for_each(item, &_vols) {
+ list_for_each_safe(item, tmp, &_vols) {
_ldm_md_t* v = list_entry(item, _ldm_md_t, list);
|