X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fmain.c;h=c0c37e1d5feeb4200f931085bd9d9e76a3f02add;hb=f3d0d7fcf0496a63625c92e5ab95471e202e958e;hp=b447f04d5efea1e35c2da4d533be69e2218ef6e2;hpb=a1b7b0fcbf99e2c53dd6d7ee5961772bf29bdb2b;p=tpg%2Facess2.git diff --git a/Kernel/vfs/main.c b/Kernel/vfs/main.c index b447f04d..c0c37e1d 100644 --- a/Kernel/vfs/main.c +++ b/Kernel/vfs/main.c @@ -13,11 +13,13 @@ 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 === @@ -25,7 +27,7 @@ EXPORT(VFS_AddDriver); // === GLOBALS === tVFS_Node NULLNode = {0}; -tSpinlock siDriverListLock = 0; +tShortSpinlock slDriverListLock; tVFS_Driver *gVFS_Drivers = NULL; char *gsVFS_DriverFile = NULL; int giVFS_DriverFileID = 0; @@ -62,18 +64,20 @@ int VFS_Init(void) } /** - * \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; tmp = VFS_GetAbsPath(Path); if(tmp == NULL) return NULL; + //Log(" VFS_GetTruePath: tmp = '%s'", tmp); node = VFS_ParsePath(tmp, &ret); free(tmp); + //Log(" VFS_GetTruePath: node=%p, ret='%s'", node, ret); if(!node) return NULL; if(node->Close) node->Close(node); @@ -88,23 +92,23 @@ char *VFS_GetTruePath(char *Path) void VFS_GetMemPath(char *Dest, void *Base, Uint Length) { Dest[0] = '$'; - itoa( &Dest[1], (Uint)Base, 16, BITS/4, '0' ); + itoa( &Dest[1], (tVAddr)Base, 16, BITS/4, '0' ); Dest[BITS/4+1] = ':'; itoa( &Dest[BITS/4+2], Length, 16, BITS/4, '0' ); Dest[BITS/2+2] = '\0'; } /** - * \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; for(;drv;drv=drv->Next) { - Log("strcmp('%s' (%p), '%s') == 0?", drv->Name, drv->Name, Name); +// Log("strcmp('%s' (%p), '%s') == 0?", drv->Name, drv->Name, Name); if(strcmp(drv->Name, Name) == 0) return drv; } @@ -118,10 +122,10 @@ int VFS_AddDriver(tVFS_Driver *Info) { if(!Info) return -1; - LOCK( &siDriverListLock ); + SHORTLOCK( &slDriverListLock ); Info->Next = gVFS_Drivers; gVFS_Drivers = Info; - RELEASE( &siDriverListLock ); + SHORTREL( &slDriverListLock ); VFS_UpdateDriverFile();