X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fmain.c;h=5ff0e7c2f2da6aeb158637311ebace9f22607bfe;hb=a2495c6ea4f4cab16b5d339ae511428e92e89e73;hp=ef1cd569bfc35c73a3708d0718ea2bf9d59ab36c;hpb=b5a1402b18d2f8cb360bf2fc524609b374bac8ec;p=tpg%2Facess2.git diff --git a/Kernel/vfs/main.c b/Kernel/vfs/main.c index ef1cd569..5ff0e7c2 100644 --- a/Kernel/vfs/main.c +++ b/Kernel/vfs/main.c @@ -4,20 +4,23 @@ */ #include #include -#include "vfs.h" -#include "vfs_int.h" -#include "vfs_ext.h" +#include +#include +#include +#include // === IMPORTS === extern tVFS_Driver gRootFS_Info; extern tVFS_Driver gDevFS_Info; // === PROTOTYPES === +#if 0 int VFS_Init(void); -char *VFS_GetTruePath(char *Path); +char *VFS_GetTruePath(const char *Path); void VFS_GetMemPath(char *Dest, void *Base, Uint Length); -tVFS_Driver *VFS_GetFSByName(char *Name); +tVFS_Driver *VFS_GetFSByName(const char *Name); int VFS_AddDriver(tVFS_Driver *Info); +#endif void VFS_UpdateDriverFile(void); // === EXPORTS === @@ -50,22 +53,23 @@ int VFS_Init(void) giVFS_DriverFileID = SysFS_RegisterFile("VFS/Drivers", NULL, 0); if( VFS_Mount("root", "/", "rootfs", "") != 0 ) { - Panic("Unable to mount root (Where the **** is rootfs?)"); + Log_KernelPanic("VFS", "Unable to mount root (Where the **** is rootfs?)"); return -1; } VFS_MkDir("/Devices"); VFS_MkDir("/Mount"); VFS_Mount("dev", "/Devices", "devfs", ""); - - CFGINT(CFG_VFS_MAXFILES) = 32; + + Log_Debug("VFS", "Setting max files"); + *Threads_GetMaxFD() = 32; return 0; } /** - * \fn char *VFS_GetTruePath(char *Path) + * \fn char *VFS_GetTruePath(const char *Path) * \brief Gets the true path (non-symlink) of a file */ -char *VFS_GetTruePath(char *Path) +char *VFS_GetTruePath(const char *Path) { tVFS_Node *node; char *ret, *tmp; @@ -73,12 +77,12 @@ char *VFS_GetTruePath(char *Path) tmp = VFS_GetAbsPath(Path); if(tmp == NULL) return NULL; //Log(" VFS_GetTruePath: tmp = '%s'", tmp); - node = VFS_ParsePath(tmp, &ret); + node = VFS_ParsePath(tmp, &ret, NULL); free(tmp); //Log(" VFS_GetTruePath: node=%p, ret='%s'", node, ret); if(!node) return NULL; - if(node->Close) node->Close(node); + if(node->Type->Close) node->Type->Close(node); return ret; } @@ -97,10 +101,10 @@ void VFS_GetMemPath(char *Dest, void *Base, Uint Length) } /** - * \fn tVFS_Driver *VFS_GetFSByName(char *Name) + * \fn tVFS_Driver *VFS_GetFSByName(const char *Name) * \brief Gets a filesystem structure given a name */ -tVFS_Driver *VFS_GetFSByName(char *Name) +tVFS_Driver *VFS_GetFSByName(const char *Name) { tVFS_Driver *drv = gVFS_Drivers;