Removed debug from FAT and VFS_ReadDir and made DevFS maintain a directory size count
authorJohn Hodge <[email protected]>
Sat, 26 Sep 2009 02:08:29 +0000 (10:08 +0800)
committerJohn Hodge <[email protected]>
Sat, 26 Sep 2009 02:08:29 +0000 (10:08 +0800)
Kernel/vfs/dir.c
Kernel/vfs/fs/devfs.c
Kernel/vfs/fs/fat.c

index 39cd3ec..5ee1661 100644 (file)
@@ -142,15 +142,15 @@ int VFS_ReadDir(int FD, char *Dest)
        tVFS_Handle     *h = VFS_GetHandle(FD);
        char    *tmp;
        
-       ENTER("ph pDest", h, Dest);
+       //ENTER("ph pDest", h, Dest);
        
        if(!h || h->Node->ReadDir == NULL) {
-               LEAVE('i', 0);
+               //LEAVE('i', 0);
                return 0;
        }
        
        if(h->Node->Size != -1 && h->Position >= h->Node->Size) {
-               LEAVE('i', 0);
+               //LEAVE('i', 0);
                return 0;
        }
        
@@ -162,10 +162,10 @@ int VFS_ReadDir(int FD, char *Dest)
                        h->Position ++;
        } while(tmp != NULL && (Uint)tmp < (Uint)VFS_MAXSKIP);
        
-       LOG("tmp = '%s'", READDIR_FIXUP(tmp));
+       //LOG("tmp = '%s'", READDIR_FIXUP(tmp));
        
        if(!tmp) {
-               LEAVE('i', 0);
+               //LEAVE('i', 0);
                return 0;
        }
        
@@ -174,6 +174,6 @@ int VFS_ReadDir(int FD, char *Dest)
        if((Uint)tmp & 1)
                free(READDIR_FIXUP(tmp));
        
-       LEAVE('i', 1);
+       //LEAVE('i', 1);
        return 1;
 }
index f5f090d..82b0387 100644 (file)
@@ -18,8 +18,9 @@ tVFS_Driver   gDevFS_Info = {
        "devfs", 0, DevFS_InitDevice, NULL, NULL
        };
 tVFS_Node      gDevFS_RootNode = {
-       .NumACLs = 1,
+       .Size = 0,
        .Flags = VFS_FFLAG_DIRECTORY,
+       .NumACLs = 1,
        .ACLs = &gVFS_ACL_EveryoneRW,
        .ReadDir = DevFS_ReadDir,
        .FindDir = DevFS_FindDir
@@ -35,7 +36,7 @@ int DevFS_AddDevice(tDevFS_Driver *Dev)
 {
        Dev->Next = gDevFS_Drivers;
        gDevFS_Drivers = Dev;
-       
+       gDevFS_RootNode.Size ++;
        return giDevFS_NextID++;
 }
 
index 88f8a09..5bd7bac 100644 (file)
@@ -8,7 +8,7 @@
 #include <vfs.h>\r
 #include "fs_fat.h"\r
 \r
-#define DEBUG  1\r
+#define DEBUG  0\r
 #define VERBOSE        1\r
 \r
 #if DEBUG\r

UCC git Repository :: git.ucc.asn.au