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

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