X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fmain.c;h=4ed782982d9a401cda595ba43da47f4fa71fd12a;hb=e47f509e07718893b837826f981085829cf16c84;hp=5ff0e7c2f2da6aeb158637311ebace9f22607bfe;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/main.c b/KernelLand/Kernel/vfs/main.c index 5ff0e7c2..4ed78298 100644 --- a/KernelLand/Kernel/vfs/main.c +++ b/KernelLand/Kernel/vfs/main.c @@ -27,7 +27,7 @@ void VFS_UpdateDriverFile(void); EXPORT(VFS_AddDriver); // === GLOBALS === -tVFS_Node NULLNode = {0}; +tVFS_Node NULLNode = {.Type=NULL}; tShortSpinlock slDriverListLock; tVFS_Driver *gVFS_Drivers = NULL; char *gsVFS_DriverFile = NULL; @@ -59,12 +59,21 @@ int VFS_Init(void) VFS_MkDir("/Devices"); VFS_MkDir("/Mount"); VFS_Mount("dev", "/Devices", "devfs", ""); - - Log_Debug("VFS", "Setting max files"); - *Threads_GetMaxFD() = 32; + + // Set default max user file count + // - Applies to PID0, but propagated to all children + *Threads_GetMaxFD(NULL) = 32; return 0; } +void VFS_Deinit(void) +{ + SysFS_RemoveFile(giVFS_MountFileID); + free(gsVFS_MountFile); + SysFS_RemoveFile(giVFS_DriverFileID); + free(gsVFS_DriverFile); +} + /** * \fn char *VFS_GetTruePath(const char *Path) * \brief Gets the true path (non-symlink) of a file @@ -164,3 +173,9 @@ void VFS_UpdateDriverFile(void) if(gsVFS_DriverFile) free(gsVFS_DriverFile); gsVFS_DriverFile = buf; } + +void VFS_CleanupNode(tVFS_Node *Node) +{ + +} +