- Main Page
- Namespaces
- Data Structures
- Files
- Directories

- Search for |

- File List
- Globals

# vfs.h File Reference

`#include <ubixos/types.h>`
`#include <vfs/file.h>`
`#include <vfs/mount.h>`
`#include <sys/sysproto.h>`
`#include <sys/thread.h>`

Go to the source code of this file.

## Data Structures
struct | fileSystem
| filesSystem Structure More...
## Defines
#define | fdAvail 1
#define | fdEof 4
#define | fdOpen 2
#define | fdRead 3
#define | fileAppend 0x0008
#define | fileBinary 0x0004
#define | fileRead 0x0001
#define | fileWrite 0x0002
#define | maxFd 32
## Functions
int | open (struct thread *td, struct open_args *uap)
fileSystem * | vfs_findFS (int)
int | vfs_init ()
int | vfsRegisterFS (struct fileSystem)
| register a file system

## Define Documentation

#define fdAvail 1

Definition at line 40 of file vfs.h.

#define fdEof 4

Definition at line 43 of file vfs.h.

Referenced by feof(), and readUbixFS().

#define fdOpen 2

Definition at line 41 of file vfs.h.

Referenced by fopen(), and writeFileByte().

#define fdRead 3

Definition at line 42 of file vfs.h.

Referenced by writeFileByte().

#define fileAppend 0x0008

Definition at line 49 of file vfs.h.

Referenced by fopen().

#define fileBinary 0x0004

Definition at line 48 of file vfs.h.

Referenced by fopen().

#define fileRead 0x0001

Definition at line 46 of file vfs.h.

Referenced by fopen(), and openFileUbixFS().

#define fileWrite 0x0002

Definition at line 47 of file vfs.h.

Referenced by fopen(), and openFileUbixFS().

#define maxFd 32

Definition at line 39 of file vfs.h.

## Function Documentation

int open | ( | struct thread * | td,
|  | struct open_args * | uap |
| ) |  |  |

Definition at line 139 of file vfs.c.

References falloc(), kprintf(), and open_args::path.

struct fileSystem* vfs_findFS | ( | int |  | ) |

int vfs_init | ( |  | ) |

Definition at line 47 of file vfs.c.

References vitalsStruct::fileSystems, kprintf(), and systemVitals.

int vfsRegisterFS | ( | struct fileSystem | newFS | ) |

register a file system

This registers a new filesystem into the vfs which is referenced when trying to mount a device

Parameters:

  | newFS | pointer to fileSystem structure

Definition at line 80 of file vfs.c.

References vitalsStruct::fileSystems, kmalloc(), kprintf(), memcpy(), fileSystem::next, NULL, fileSystem::prev, systemVitals, vfsFindFS(), fileSystem::vfsType, and x1.

Referenced by devfs_init(), ubixfs_init(), and ufs_init().