From: John Hodge Date: Sat, 26 Sep 2009 02:08:29 +0000 (+0800) Subject: Removed debug from FAT and VFS_ReadDir and made DevFS maintain a directory size count X-Git-Tag: rel0.06~493 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=eee93d35af3d95f69c61ed05b1afa54f5acac9b9;p=tpg%2Facess2.git Removed debug from FAT and VFS_ReadDir and made DevFS maintain a directory size count --- diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index 39cd3ecb..5ee16618 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -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; } diff --git a/Kernel/vfs/fs/devfs.c b/Kernel/vfs/fs/devfs.c index f5f090df..82b0387b 100644 --- a/Kernel/vfs/fs/devfs.c +++ b/Kernel/vfs/fs/devfs.c @@ -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++; } diff --git a/Kernel/vfs/fs/fat.c b/Kernel/vfs/fs/fat.c index 88f8a09d..5bd7bace 100644 --- a/Kernel/vfs/fs/fat.c +++ b/Kernel/vfs/fs/fat.c @@ -8,7 +8,7 @@ #include #include "fs_fat.h" -#define DEBUG 1 +#define DEBUG 0 #define VERBOSE 1 #if DEBUG