UbixOS V2 2.0

Macros | Functions
ufs.c File Reference
`#include <sys/types.h>`
`#include <vfs/vfs.h>`
`#include <vfs/file.h>`
`#include <ufs/ufs.h>`
`#include <ufs/ffs.h>`
`#include <lib/kprintf.h>`
`#include <lib/kmalloc.h>`
`#include <ubixos/kpanic.h>`
`#include <string.h>`
Include dependency graph for ufs.c:

Go to the source code of this file.

## Macros
#define | DBPERVBLK (VBLKSIZE / DEV_BSIZE)
#define | DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field
#define | INDIRPERVBLK(fs) (NINDIR(fs) / ((fs)->fs_bsize >> VBLKSHIFT))
#define | INO_TO_VBA(fs, ipervblk, x)
#define | INO_TO_VBO(ipervblk, x) ((x) % ipervblk)
#define | INOPB(fs) ((fs)->fs_inopb)
#define | IPERVBLK(fs) (INOPB(fs) / ((fs)->fs_bsize >> VBLKSHIFT))
#define | VBLKMASK (VBLKSIZE - 1)
#define | VBLKSHIFT 12
#define | VBLKSIZE (1 << VBLKSHIFT)

## Functions
int | ufs_init ()
int | ufs_initialize (struct vfs_mountPoint *mp)
int | ufs_readFile (fileDescriptor_t *fd, char *data, uInt32 offset, long size)
int | ufs_writeFile (fileDescriptor_t *fd, char *data, uInt32 offset, long size)

## Macro Definition Documentation

## ◆ DBPERVBLK

#define DBPERVBLK (VBLKSIZE / DEV_BSIZE)

Definition at line 42 of file ufs.c.

## ◆ DIP

#define DIP | ( |  | field | ) | fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field

Definition at line 73 of file ufs.c.

## ◆ INDIRPERVBLK

#define INDIRPERVBLK | ( |  | fs | ) | (NINDIR(fs) / ((fs)->fs_bsize >> VBLKSHIFT))

Definition at line 43 of file ufs.c.

## ◆ INO_TO_VBA

#define INO_TO_VBA | ( |  | fs,
|  |  | ipervblk,
|  |  | x
| ) |  |

Value:
(fsbtodb(fs, cgimin(fs, ino_to_cg(fs, x))) + \
(((x) % (fs)->fs_ipg) / (ipervblk) * DBPERVBLK))

Definition at line 46 of file ufs.c.

## ◆ INO_TO_VBO

#define INO_TO_VBO | ( |  | ipervblk,
|  |  | x
| ) |  | ((x) % ipervblk)

Definition at line 49 of file ufs.c.

## ◆ INOPB

#define INOPB | ( |  | fs | ) | ((fs)->fs_inopb)

Definition at line 45 of file ufs.c.

## ◆ IPERVBLK

#define IPERVBLK | ( |  | fs | ) | (INOPB(fs) / ((fs)->fs_bsize >> VBLKSHIFT))

Definition at line 44 of file ufs.c.

## ◆ VBLKMASK

#define VBLKMASK (VBLKSIZE - 1)

Definition at line 41 of file ufs.c.

## ◆ VBLKSHIFT

#define VBLKSHIFT 12

Definition at line 39 of file ufs.c.

## ◆ VBLKSIZE

#define VBLKSIZE (1 << VBLKSHIFT)

Definition at line 40 of file ufs.c.

## Function Documentation

## ◆ ufs_init()

int ufs_init | ( |  | ) |

Definition at line 313 of file ufs.c.

## ◆ ufs_initialize()

int ufs_initialize | ( | struct vfs_mountPoint * | mp | ) |

Definition at line 308 of file ufs.c.

## ◆ ufs_readFile()

int ufs_readFile | ( | fileDescriptor_t * | fd,
|  | char * | data,
|  | uInt32 | offset,
|  | long | size
| ) |  |

Definition at line 291 of file ufs.c.

## ◆ ufs_writeFile()

int ufs_writeFile | ( | fileDescriptor_t * | fd,
|  | char * | data,
|  | uInt32 | offset,
|  | long | size
| ) |  |

Definition at line 295 of file ufs.c.

References kprintf().

Here is the call graph for this function:
fs
Definition: fs.h:260
ino_to_cg
#define ino_to_cg(fs, x)
Definition: fs.h:545
DBPERVBLK
#define DBPERVBLK
Definition: ufs.c:42
cgimin
#define cgimin(fs, c)
Definition: fs.h:532
fsbtodb
#define fsbtodb(fs, b)
Definition: fs.h:521