#include <vfs/vfs.h>#include <ufs/ufs.h>#include <ufs/ffs.h>#include <lib/kprintf.h>#include <lib/kmalloc.h>#include <ubixos/kpanic.h>#include <lib/string.h>Include dependency graph for ufs.c:

Go to the source code of this file.
Defines | |
| #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 | |
| static int | dskread (void *buf, u_int64_t block, size_t count, fileDescriptor *fd) |
| static __inline int | fsfind (const char *name, ino_t *ino, fileDescriptor *fd) |
| static ssize_t | fsread (ino_t inode, void *buf, size_t nbyte, fileDescriptor *fd) |
| static ino_t | lookup (const char *path, fileDescriptor *fd) |
| int | ufs_init () |
| int | ufs_initialize (struct vfs_mountPoint *mp) |
| static int | ufs_openFile (const char *file, fileDescriptor *fd) |
| int | ufs_readFile (fileDescriptor *fd, char *data, uInt32 offset, long size) |
| int | ufs_writeFile (fileDescriptor *fd, char *data, uInt32 offset, long size) |
Variables | |
| static int | sblock_try [] = SBLOCKSEARCH |
| #define DBPERVBLK (VBLKSIZE / DEV_BSIZE) |
| #define DIP | ( | field | ) | fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field |
| #define INO_TO_VBA | ( | fs, | |||
| ipervblk, | |||||
| x | ) |
| #define INO_TO_VBO | ( | ipervblk, | |||
| x | ) | ((x) % ipervblk) |
| static int dskread | ( | void * | buf, | |
| u_int64_t | block, | |||
| size_t | count, | |||
| fileDescriptor * | fd | |||
| ) | [static] |
Definition at line 51 of file ufs.c.
References vfs_mountPoint::device, device_node::devInfo, device_interface::info, fileDescriptorStruct::mp, and device_interface::read.
Referenced by fsread().
| static __inline int fsfind | ( | const char * | name, | |
| ino_t * | ino, | |||
| fileDescriptor * | fd | |||
| ) | [static] |
Definition at line 214 of file ufs.c.
References dirent::d_fileno, dirent::d_name, dirent::d_reclen, dirent::d_type, DEV_BSIZE, fsread(), fileDescriptorStruct::offset, and strcmp().
Referenced by lookup().
Here is the call graph for this function:

| static ssize_t fsread | ( | ino_t | inode, | |
| void * | buf, | |||
| size_t | nbyte, | |||
| fileDescriptor * | fd | |||
| ) | [static] |
Definition at line 77 of file ufs.c.
References dmadat::blkbuf, blkoff, DBPERVBLK, DEV_BSHIFT, DEV_BSIZE, ufs2_dinode::di_db, ufs2_dinode::di_ib, ufs2_dinode::di_size, DIP, fileDescriptorStruct::dmadat, fileDescriptorStruct::dsk_meta, dskread(), fs::fs_magic, FS_UFS1_MAGIC, FS_UFS2_MAGIC, fsbtodb, dmadat::indbuf, INDIRPERVBLK, INO_TO_VBA, INO_TO_VBO, IPERVBLK, kprintf(), lblkno, MAXBSIZE, memcpy(), NDADDR, NINDIR, fileDescriptorStruct::offset, dmadat::sbbuf, sblksize, sblock_try, fileDescriptorStruct::size, VBLKMASK, VBLKSHIFT, and VBLKSIZE.
Referenced by fsfind(), ufs_openFile(), and ufs_readFile().
Here is the call graph for this function:

| static ino_t lookup | ( | const char * | path, | |
| fileDescriptor * | fd | |||
| ) | [static] |
| int ufs_init | ( | ) |
Definition at line 314 of file ufs.c.
References kpanic(), NULL, ufs_initialize(), ufs_openFile(), ufs_readFile(), ufs_writeFile(), vfsRegisterFS(), and x1.
Here is the call graph for this function:

| int ufs_initialize | ( | struct vfs_mountPoint * | mp | ) |
| static int ufs_openFile | ( | const char * | file, | |
| fileDescriptor * | fd | |||
| ) | [static] |
Definition at line 272 of file ufs.c.
References fileDescriptorStruct::dmadat, fsread(), fileDescriptorStruct::ino, kmalloc(), lookup(), fileDescriptorStruct::offset, fileDescriptorStruct::perms, and x1.
Referenced by ufs_init().
Here is the call graph for this function:

| int ufs_readFile | ( | fileDescriptor * | fd, | |
| char * | data, | |||
| uInt32 | offset, | |||
| long | size | |||
| ) |
Definition at line 291 of file ufs.c.
References fsread(), and fileDescriptorStruct::ino.
Referenced by ufs_init().
Here is the call graph for this function:

| int ufs_writeFile | ( | fileDescriptor * | fd, | |
| char * | data, | |||
| uInt32 | offset, | |||
| long | size | |||
| ) |
Definition at line 295 of file ufs.c.
References kprintf().
Referenced by ufs_init().
Here is the call graph for this function:

int sblock_try[] = SBLOCKSEARCH [static] |
1.4.7