Kernel/VFS - Added unmount support
[tpg/acess2.git] / KernelLand / Kernel / include / vfs_int.h
1 /* 
2  * Acess Micro - VFS Server Ver 1
3  */
4 #ifndef _VFS_INT_H
5 #define _VFS_INT_H
6
7 #include "vfs.h"
8 #include <rwlock.h>
9
10 // === TYPES ===
11 typedef struct sVFS_Mount {
12         struct sVFS_Mount       *Next;
13         char    *MountPoint;
14         size_t  MountPointLen;
15         Uint32  Identifier;
16         char    *Device;
17         char    *Options;
18         tVFS_Driver     *Filesystem;
19         tVFS_Node       *RootNode;
20         
21          int    OpenHandleCount;
22         
23         char    StrData[];
24 } tVFS_Mount;
25
26 typedef struct sVFS_Handle {
27         tVFS_Node       *Node;
28         tVFS_Mount      *Mount;
29         Uint64  Position;
30         Uint    Mode;
31 } tVFS_Handle;
32
33 typedef struct sVFS_Proc {
34         struct sVFS_Proc        *Next;
35          int    ID;
36          int    CwdLen;
37         Uint    UID, GID;
38         char    *Cwd;
39          int    MaxHandles;
40         tVFS_Handle     Handles[];
41 } tVFS_Proc;
42
43 typedef struct sVFS_MMapPage {
44         Uint64  FileOffset;
45         tPAddr  PAddr;
46 } tVFS_MMapPage;
47
48 // === GLOBALS ===
49 extern tRWLock          glVFS_MountList;
50 extern tVFS_Mount       *gVFS_Mounts;
51
52 // === PROTOTYPES ===
53 // --- open.c ---
54 extern char     *VFS_GetAbsPath(const char *Path);
55 extern tVFS_Node        *VFS_ParsePath(const char *Path, char **TruePath, tVFS_Mount **MountPoint);
56 extern tVFS_Handle      *VFS_GetHandle(int FD);
57 // --- acls.c ---
58 extern int      VFS_CheckACL(tVFS_Node *Node, Uint Permissions);
59 // --- mount.c ---
60 extern tVFS_Mount       *VFS_GetMountByIdent(Uint32 MountID);
61 // --- dir.c ---
62 extern int      VFS_MkNod(const char *Path, Uint Flags);
63
64
65 // --- VFS Helpers ---
66 static inline void _CloseNode(tVFS_Node *Node)
67 {
68         if(Node && Node->Type && Node->Type->Close)
69                 Node->Type->Close( Node );
70 }
71
72
73 #endif

UCC git Repository :: git.ucc.asn.au