X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Finclude%2Fvfs_int.h;h=c2dacd349771c5e6028c6e92caf42e644636a6f5;hb=1c388a6c77f8f04b269051d0e089eaab9e45b391;hp=f48e277b4269d490d983d5450c7536ac709dfb19;hpb=11dbd684e9a3d907d43d71a3145205f1a86992fb;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/include/vfs_int.h b/KernelLand/Kernel/include/vfs_int.h index f48e277b..c2dacd34 100644 --- a/KernelLand/Kernel/include/vfs_int.h +++ b/KernelLand/Kernel/include/vfs_int.h @@ -48,8 +48,10 @@ typedef struct sVFS_MMapPage { // === GLOBALS === extern tRWLock glVFS_MountList; extern tVFS_Mount *gVFS_Mounts; +extern tVFS_Driver *gVFS_Drivers; // === PROTOTYPES === +extern void VFS_Deinit(void); // --- open.c --- extern char *VFS_GetAbsPath(const char *Path); extern tVFS_Node *VFS_ParsePath(const char *Path, char **TruePath, tVFS_Mount **MountPoint); @@ -60,6 +62,9 @@ extern int VFS_CheckACL(tVFS_Node *Node, Uint Permissions); extern tVFS_Mount *VFS_GetMountByIdent(Uint32 MountID); // --- dir.c --- extern int VFS_MkNod(const char *Path, Uint Flags); +// --- handle.c --- +extern int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode); +extern int VFS_SetHandle(int FD, tVFS_Node *Node, int Mode); // --- VFS Helpers --- @@ -68,6 +73,18 @@ static inline void _CloseNode(tVFS_Node *Node) if(Node && Node->Type && Node->Type->Close) Node->Type->Close( Node ); } +static inline void _ReferenceNode(tVFS_Node *Node) +{ + if( !MM_GetPhysAddr(Node->Type) ) { + Log_Error("VFS", "Node %p's type is invalid (%p bad pointer) - %P corrupted", + Node, Node->Type, MM_GetPhysAddr(&Node->Type)); + return ; + } + if( Node->Type && Node->Type->Reference ) + Node->Type->Reference( Node ); + else + Node->ReferenceCount ++; +} #endif