2 * Acess Micro - VFS Server Ver 1
11 typedef struct sVFS_Mount {
12 struct sVFS_Mount *Next;
18 tVFS_Driver *Filesystem;
26 typedef struct sVFS_Handle {
33 typedef struct sVFS_Proc {
34 struct sVFS_Proc *Next;
40 tVFS_Handle Handles[];
43 typedef struct sVFS_MMapPage {
49 extern tRWLock glVFS_MountList;
50 extern tVFS_Mount *gVFS_Mounts;
51 extern tVFS_Driver *gVFS_Drivers;
54 extern void VFS_Deinit(void);
56 extern char *VFS_GetAbsPath(const char *Path);
57 extern tVFS_Node *VFS_ParsePath(const char *Path, char **TruePath, tVFS_Mount **MountPoint);
58 extern tVFS_Handle *VFS_GetHandle(int FD);
60 extern int VFS_CheckACL(tVFS_Node *Node, Uint Permissions);
62 extern tVFS_Mount *VFS_GetMountByIdent(Uint32 MountID);
64 extern int VFS_MkNod(const char *Path, Uint Flags);
66 extern int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode);
67 extern int VFS_SetHandle(int FD, tVFS_Node *Node, int Mode);
70 // --- VFS Helpers ---
71 static inline void _CloseNode(tVFS_Node *Node)
73 if(Node && Node->Type && Node->Type->Close)
74 Node->Type->Close( Node );
76 static inline void _ReferenceNode(tVFS_Node *Node)
78 if( !MM_GetPhysAddr(Node->Type) ) {
79 Log_Error("VFS", "Node %p's type is invalid (%p bad pointer) - %P corrupted",
80 Node, Node->Type, MM_GetPhysAddr(&Node->Type));
83 if( Node->Type && Node->Type->Reference )
84 Node->Type->Reference( Node );
86 Node->ReferenceCount ++;