include/vfs.h File Reference


Detailed Description

Acess VFS Layer.

The Acess Virtual File System (VFS) provides abstraction of multiple physical filesystems, network storage and devices (both hardware and virtual) to the user.

The core of the VFS is the concept of a VFS Node. A VFS Node represents a "file" in the VFS tree, this can be any sort of file (an ordinary file, a directory, a symbolic link or a device) depending on the bits set in the tVFS_Node::Flags Flags field.

Go to the source code of this file.

Data Structures

struct  tVFS_Node
 Represents a node (file or directory) in the VFS tree. More...
struct  tVFS_Driver
 VFS Driver (Filesystem) Definition. More...

Defines

#define VFS_MAXSKIP   ((void*)1024)
 Maximum number of elements that can be skipped in one return.
#define VFS_SKIP   ((void*)1)
 Skip a single entry in readdir.
#define VFS_SKIPN(n)   ((void*)(n))
 Skip n entries in readdir.
tVFS_Node Flags

Flag values for tVFS_Node.Flags

#define VFS_FFLAG_READONLY   0x01
#define VFS_FFLAG_DIRECTORY   0x02
 Directory Flag.
#define VFS_FFLAG_SYMLINK   0x04
 Symbolic Link Flag.
#define VFS_FFLAG_SETUID   0x08
 Set User ID Flag.
#define VFS_FFLAG_SETGID   0x10
 Set Group ID Flag.

Functions

int VFS_AddDriver (tVFS_Driver *Info)
 Registers the driver with the DevFS layer.
tVFS_DriverVFS_GetFSByName (const char *Name)
tVFS_ACLVFS_UnixToAcessACL (Uint Mode, Uint Owner, Uint Group)
 Transforms Unix Permssions into Acess ACLs.
Node Cache

Functions to allow a node to be cached in memory by the VFS

These functions store a node for the driver, to prevent it from having to re-generate the node on each call to FindDir. It also allows for fast cleanup when a filesystem is unmounted.

int Inode_GetHandle (void)
 Gets a unique handle to the Node Cache.
tVFS_NodeInode_GetCache (int Handle, Uint64 Inode)
 Gets an inode from the node cache.
tVFS_NodeInode_CacheNode (int Handle, tVFS_Node *Node)
 Caches a node in the Node Cache.
void Inode_UncacheNode (int Handle, Uint64 Inode)
 Dereferences (and removes if needed) a node from the cache.
void Inode_ClearCache (int Handle)
 Clears the cache for a handle.

Variables

tVFS_Node NULLNode
 NULL VFS Node (Ignored/Skipped).
Static ACLs

Simple ACLs to aid writing drivers

tVFS_ACL gVFS_ACL_EveryoneRWX
 Everyone Read/Write/Execute.
tVFS_ACL gVFS_ACL_EveryoneRW
 Everyone Read/Write.
tVFS_ACL gVFS_ACL_EveryoneRX
 Everyone Read/Execute.
tVFS_ACL gVFS_ACL_EveryoneRO
 Everyone Read only.

Define Documentation

#define VFS_FFLAG_DIRECTORY   0x02

Directory Flag.

This flag marks the tVFS_Node as describing a directory, and says that the tVFS_Node.FindDir, tVFS_Node.ReadDir, tVFS_Node.MkNod and tVFS_Node.Relink function pointers are valid. For a directory the tVFS_Node.Size field contains the number of files within the directory, or -1 for undetermined.

#define VFS_FFLAG_READONLY   0x01
Todo:
Is this still needed

Readonly File

#define VFS_FFLAG_SETGID   0x10

Set Group ID Flag.

Allows an executable file to change it's executing group to the file's owning group. In the case of a directory, it means that all immediate children will inherit the GID of the parent.

#define VFS_FFLAG_SETUID   0x08

Set User ID Flag.

Allows an executable file to change it's executing user to the file's owner. In the case of a directory, it means that all immediate children will inherit the UID of the parent.

#define VFS_FFLAG_SYMLINK   0x04

Symbolic Link Flag.

Marks a file as a symbolic link


Function Documentation

tVFS_Node * Inode_CacheNode ( int  Handle,
tVFS_Node Node 
)

Caches a node in the Node Cache.

Parameters:
Handle A handle returned by Inode_GetHandle()
Node A pointer to the node to be cached (a copy is taken)
Returns:
A pointer to the node in the node cache
void Inode_ClearCache ( int  Handle  ) 

Clears the cache for a handle.

Parameters:
Handle A handle returned by Inode_GetHandle()
tVFS_Node * Inode_GetCache ( int  Handle,
Uint64  Inode 
)

Gets an inode from the node cache.

Parameters:
Handle A handle returned by Inode_GetHandle()
Inode Value of the Inode field of the tVFS_Node you want
Returns:
A pointer to the cached node
int Inode_GetHandle ( void   ) 

Gets a unique handle to the Node Cache.

Returns:
A unique handle for use for the rest of the Inode_* functions
int Inode_UncacheNode ( int  Handle,
Uint64  Inode 
)

Dereferences (and removes if needed) a node from the cache.

Parameters:
Handle A handle returned by Inode_GetHandle()
Inode Value of the Inode field of the tVFS_Node you want to remove
int VFS_AddDriver ( tVFS_Driver Info  ) 

Registers the driver with the DevFS layer.

Parameters:
Info Driver information structure
tVFS_ACL * VFS_UnixToAcessACL ( Uint  Mode,
Uint  Owner,
Uint  Group 
)

Transforms Unix Permssions into Acess ACLs.

Parameters:
Mode Unix RWXrwxRWX mask
Owner UID of the file's owner
Group GID of the file's owning group
Returns:
An array of 3 Acess ACLs
Generated on Mon Feb 14 15:21:31 2011 for Acess2 by  doxygen 1.6.3