[Kos-cvs] kos/modules/fs/fat Makefile, 1.5, 1.6 _fat.c, 1.10, 1.11 _fat_karm.c, 1.8, 1.9

thomas at kos.enix.org thomas at kos.enix.org
Sun Jan 30 17:11:22 CET 2005


Update of /home/kos/cvs/kos/modules/fs/fat
In directory the-doors:/tmp/cvs-serv3480/modules/fs/fat

Modified Files:
	Makefile _fat.c _fat_karm.c 
Log Message:
2005-01-30  Thomas Petazzoni  <thomas at crazy.kos.nx>

	* modules/x86/mm/Makefile (DEBUG_LEVEL): 1 -> 0

	* modules/vmm/_vmm_as.c: Moved as_dump and vr_dump, create
	as_dump_unsafe.

	* modules/vmm/Makefile (DEBUG_LEVEL): 3 -> 0

	* modules/tty/_tty.c, modules/tty/_tty_kres.c: DEBUG_PRINTx
	conformance + memset().

	* modules/lib/blockfile/libblockfile.c,
	modules/lib/charfile/libcharfile.c,
	modules/lib/filemap/libfilemap.c: Added memset() needed when
	allocated buffer is poisoned. Whitespaces.

	* modules/kmem/_kvmem_free.c: DEBUG_PRINTx conformance +
	whitespaces.

	* modules/kmem/_kvmem_alloc.c (kvalloc): Poison the allocated
	memory + DEBUG_PRINTx conformance.

	* modules/kmem/_kslab_cache_free.c (__kslab_cache_free_by_slab):
	Poison the freed buffer.

	* modules/kmem/_kslab_cache_alloc.c (kslab_cache_alloc): Poison
	the allocated buffer.

	* modules/kmem/_kmem_free.c (kfree): DEBUG_PRINTx conformance.

	* modules/kmem/_kmem_alloc.c (kmalloc): Whitespaces + DEBUG_PRINTx
	conformance.

	* modules/kitc/_kmutex.c: Remove [function] as they are generated
	by DEBUG_PRINTx now.

	* modules/karm/open.c: Whitespaces.

	* modules/karm/mount.c (mount): Cleaned the way of calling
	fs->attach().

	* modules/ide/_ide_karm.c: More debugging messages.

	* modules/ide/_ide.h (ide_device_info): Correct position of packed
	attribute to make gcc happy.

	* modules/part/Makefile (DEBUG_LEVEL), modules/karm/Makefile
	(DEBUG_LEVEL), modules/ide/Makefile
	(DEBUG_LEVEL), modules/fs/devfs/Makefile
	(DEBUG_LEVEL), modules/fs/fat/Makefile
	(DEBUG_LEVEL) : New variable.

	* modules/fs/devfs/devfs.c, modules/fs/fat/_fat.c,
	modules/fs/fat/_fat_karm.c: Added memset() found using the
	poisoning stuff in kmem. More debugging messages using
	DEBUG_PRINTx.

	* modules/debug/debug.h: DEBUG_PRINTx macros now call
	DEBUG_PRINT_VERBOSE instead of __dbg_printk, so that the line
	number, function and file names are printed before the debug
	message.

	* TODO: More things to do.



Index: _fat_karm.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/fs/fat/_fat_karm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- _fat_karm.c	29 Dec 2003 13:42:50 -0000	1.8
+++ _fat_karm.c	30 Jan 2005 16:11:20 -0000	1.9
@@ -426,6 +426,8 @@
       return -ENOMEM;
     }
 
+  memset(view, 0, sizeof(struct view));
+
   view_data = kmalloc(sizeof(struct fat_dir_view_data));
   if (view_data == NULL)
     {
@@ -434,6 +436,8 @@
       return -ENOMEM;
     }
 
+  memset(view_data, 0, sizeof(struct fat_dir_view_data));
+
   view_data->fs = fat_fs;
   if (is_rootdir)
     {
@@ -507,6 +511,8 @@
       return -ENOMEM;
     }
 
+  memset(view, 0, sizeof(struct view));
+
   view_data = kmalloc(sizeof(struct fat_file_view_data));
   if (view_data == NULL)
     {
@@ -515,6 +521,8 @@
       return -ENOMEM;
     }
 
+  memset(view_data, 0, sizeof(struct fat_file_view_data));
+
   view_data->fs = fat_fs;
   view_data->start_cluster = start_cluster;
   view_data->size = size;

Index: _fat.c
===================================================================
RCS file: /home/kos/cvs/kos/modules/fs/fat/_fat.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- _fat.c	28 Dec 2004 18:44:21 -0000	1.10
+++ _fat.c	30 Jan 2005 16:11:20 -0000	1.11
@@ -664,6 +664,8 @@
   struct fat_filesystem *fat_fs;
   UNUSED(conf);
 
+  DEBUG_PRINT3("[fat_attach] begin\n");
+
   if (file == NULL || root == NULL || fs_info == NULL)
     {
       return -EINVAL;
@@ -677,9 +679,13 @@
       return -ENOMEM;
     }
 
+  memset(fat_fs, 0x0, sizeof(struct fat_filesystem));
+
   result = fat_read_superblock(file, fat_fs);
   if(result < 0)
     {
+      DEBUG_PRINT2("[fat_attach] fat_read_superblock failed : %s\n",
+		   strerror(result));
       kfree(fat_fs);
       return result;
     }
@@ -699,6 +705,8 @@
 
   if(result < 0)
     {
+      DEBUG_PRINT2("[fat_attach] fat_build_dir_kres failed : %s\n",
+		   strerror(result));
       kfree(fat_fs);
       return result;
     }

Index: Makefile
===================================================================
RCS file: /home/kos/cvs/kos/modules/fs/fat/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Makefile	20 Aug 2003 21:32:31 -0000	1.5
+++ Makefile	30 Jan 2005 16:11:20 -0000	1.6
@@ -1,5 +1,7 @@
 OBJS= _fat.o _fat_karm.o fat.o
 
+DEBUG_LEVEL=0
+
 all:fat.ro
 
 fat.ro: $(OBJS)



More information about the Kos-cvs mailing list