Changes by: jkemi
Update of /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions
In directory usw-pr-cvs1:/tmp/cvs-serv17476
Modified Files:
Makefile ldm.c ldm.h
Log Message:
_ldm_printf(), defines, misc fixes
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -U2 -r1.5 -r1.6
--- Makefile 14 Dec 2001 19:30:29 -0000 1.5
+++ Makefile 20 Apr 2002 16:51:43 -0000 1.6
@@ -10,5 +10,5 @@
O_TARGET := partitions.o
-export-objs := check.o ibm.o
+export-objs := check.o ibm.o msdos.o
obj-y := check.o
@@ -28,2 +28,3 @@
include $(TOPDIR)/Rules.make
+
Index: ldm.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -U2 -r1.74 -r1.75
--- ldm.c 18 Apr 2002 23:58:53 -0000 1.74
+++ ldm.c 20 Apr 2002 16:51:43 -0000 1.75
@@ -27,4 +27,5 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
+#include <linux/stringify.h>
#include "ldm.h"
#include "check.h"
@@ -42,6 +43,4 @@
extern void ldm_md_addpart(const u8 *dg_guid, u32 objid, u8 comptype,
u8 n, u8 parts, u8 chunk_s, kdev_t dev);
-#else
-# define ldm_md_addpart(...) do {} while (0)
#endif
@@ -65,18 +64,13 @@
# define DEBUG_ON BUG_ON
# define ldm_debug(f, a...) \
- _ldm_printf (LDM_LVL_DEBUG, __FILE__, __LINE__, __func__, f, ##a)
+ _ldm_printf (LDM_DEBUG, __LINE__, __func__, f, ##a)
#endif
-#define ldm_crit(f, a...) \
- _ldm_printf (LDM_LVL_CRIT, __FILE__, __LINE__, __func__, f, ##a)
-
-#define ldm_error(f, a...) \
- _ldm_printf (LDM_LVL_ERR, __FILE__, __LINE__, __func__, f, ##a)
+#define ldm_crit(f, a...) _ldm_printf (LDM_CRIT, __LINE__, __func__, f, ##a)
+#define ldm_error(f, a...) _ldm_printf (LDM_ERR, __LINE__, __func__, f, ##a)
+#define ldm_info(f, a...) _ldm_printf (LDM_INFO, __LINE__, __func__, f, ##a)
-#define ldm_info(f, a...) \
- _ldm_printf (LDM_LVL_INFO, __FILE__, __LINE__, __func__, f, ##a)
-
-__attribute__ ((format (printf, 5, 6)))
-static void _ldm_printf (unsigned level, const char *file, int line,
+__attribute__ ((format (printf, 4, 5)))
+static void _ldm_printf (unsigned level, int line,
const char *function, const char *fmt, ...)
{
@@ -84,7 +78,15 @@
va_list args;
static const char *const prefix[] = {
- KERN_CRIT, KERN_ERR, KERN_INFO, KERN_DEBUG, ""};
- static const char *const label[] = {
- "CRITICAL", "ERROR", "INFO", "DEBUG", ""};
+ KERN_CRIT "(CRITICAL)",
+ KERN_ERR "(ERROR)",
+ KERN_INFO "(INFO)",
+ KERN_DEBUG "(DEBUG)"};
+
+ const char* file =
+#ifdef KBUILD_BASENAME
+ __stringify (KBUILD_BASENAME);
+#else
+ "ldm.c"; // FIXME: __FILE__ is to verbose.
+#endif
va_start(args, fmt);
@@ -92,11 +94,6 @@
va_end(args);
- // FIXME: is it possible to make __FILE__ less detailed?
- file = "ldm.c";
- if (level > LDM_LVL_NONE)
- level = LDM_LVL_NONE;
-
- printk("%s(%s) (%s, %d) %s(): %s\n", prefix[level], label[level],
- file, line, function, buf);
+ printk("%s (%s, %d) %s(): %s\n", prefix[level], file, line, function,
+ buf);
}
@@ -554,9 +551,7 @@
ldm_info ("VBLKs start at offset 0x%04x.", vm->vblk_offset);
- if ((vm->vblk_size * vm->last_vblk_seq) != (toc->bitmap1_size * 512)) {
- ldm_error ("VMDB and TOCBLOCK don't agree on the database size."
- "Aborting.");
- goto out;
- }
+ /* FIXME: How should we handle this situation? */
+ if ((vm->vblk_size * vm->last_vblk_seq) != (toc->bitmap1_size * 512))
+ ldm_info ("VMDB and TOCBLOCK don't agree on the database size.");
result = TRUE;
@@ -783,8 +778,10 @@
}
/* Register to LDM_MD */
+#ifdef CONFIG_LDM_MD
ldm_md_addpart(v->vblk.volu.guid, c->obj_id,
- c->vblk.comp.type, part->partnum, c->vblk.comp.n_childs,
+ c->vblk.comp.type, part->partnum, c->vblk.comp.children,
c->vblk.comp.chunksize / (4096 / 512), dev);
#endif
+#endif
}
@@ -935,7 +932,6 @@
comp->children = ldm_get_vnum (buffer + 0x1D + r_vstate);
comp->parent_id = ldm_get_vnum (buffer + 0x2D + r_child);
-#ifdef CONFIG_BLK_DEV_MD
comp->chunksize = r_stripe ? ldm_get_vnum (buffer+r_parent+0x2E) : 0;
-#endif
+
return TRUE;
}
@@ -1620,3 +1616,2 @@
return err;
}
-
Index: ldm.h
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/linux/fs/partitions/ldm.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -U2 -r1.44 -r1.45
--- ldm.h 15 Apr 2002 21:57:33 -0000 1.44
+++ ldm.h 20 Apr 2002 16:51:43 -0000 1.45
@@ -32,11 +32,9 @@
#include <asm/byteorder.h>
-/* Borrowed from kernel.h. */
enum {
- LDM_LVL_CRIT, /* critical conditions */
- LDM_LVL_ERR, /* error conditions */
- LDM_LVL_INFO, /* informative messages */
- LDM_LVL_DEBUG, /* debug-level messages */
- LDM_LVL_NONE
+ LDM_CRIT, /* critical conditions */
+ LDM_ERR, /* error conditions */
+ LDM_INFO, /* informative messages */
+ LDM_DEBUG /* debug-level messages */
};
@@ -158,7 +156,5 @@
u8 type;
u8 children;
-#ifdef CONFIG_BLK_DEV_MD
u16 chunksize;
-#endif
};
|