|
UbixOS V2
2.0
|
#include <sys/types.h>#include <vfs/vfs.h>#include <sys/device.h>#include <mpi/mpi.h>#include <ubixfs/dirCache.h>

Go to the source code of this file.
Data Structures | |
| struct | blockAllocationTableEntry |
| struct | bootSect |
| struct | directoryEntry |
| struct | directoryList |
| struct | partitionInformation |
| struct | ubixDiskLabel |
| struct | ubixDiskLabel::ubixPartitions |
| struct | ubixFSInfo |
Macros | |
| #define | blockSize 8 |
| #define | EOBC -1 |
| #define | MAXUBIXPARTITIONS 16 |
| #define | typeContainer 2 |
| #define | typeDeleted 8 |
| #define | typeDirectory 4 |
| #define | typeFile 1 |
| #define | UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */ |
| #define | UBIXFS_ALIGN(size) (size + ((((size) % (UBIXFS_BLOCKSIZE_BYTES)) == 0)? 0 : ((UBIXFS_BLOCKSIZE_BYTES) - ((size) % (UBIXFS_BLOCKSIZE_BYTES))))) |
| #define | UBIXFS_BLOCKSIZE_BYTES blockSize*512 |
Typedefs | |
| typedef struct directoryList * | dirList_t |
Functions | |
| int | addDirEntry (struct directoryEntry *dir, fileDescriptor_t *fd) |
| int | freeBlocks (int block, fileDescriptor_t *fd) |
| int | getFreeBlocks (int count, fileDescriptor_t *fd) |
| int | readFile (char *file) |
| int | readUbixFS (fileDescriptor_t *fd, char *data, uInt32, long size) |
| void | syncBat (struct vfs_mountPoint *mp) |
| int | ubixfs_init () |
| int | ubixfs_initialize () |
| void | ubixfs_thread () |
| dirList_t | ubixFSLoadDir (char *) |
| int | ubixFSmkDir (char *dir, fileDescriptor_t *fd) |
| void | ubixFSUnlink (char *path, struct vfs_mountPoint *mp) |
| int | writeFileByte (int ch, fileDescriptor_t *fd, long offset) |
| int | writeUbixFS (fileDescriptor_t *fd, char *data, long offset, long size) |
| #define UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */ |
| #define UBIXFS_ALIGN | ( | size | ) | (size + ((((size) % (UBIXFS_BLOCKSIZE_BYTES)) == 0)? 0 : ((UBIXFS_BLOCKSIZE_BYTES) - ((size) % (UBIXFS_BLOCKSIZE_BYTES))))) |
| typedef struct directoryList* dirList_t |
| int addDirEntry | ( | struct directoryEntry * | dir, |
| fileDescriptor_t * | fd | ||
| ) |
Definition at line 64 of file directory.c.
References kmalloc(), kprintf(), memcpy(), fileDescriptor::offset, readUbixFS(), fileDescriptor::size, and writeUbixFS().
Referenced by ubixFSmkDir().

| int freeBlocks | ( | int | block, |
| fileDescriptor_t * | fd | ||
| ) |
Definition at line 78 of file block.c.
References blockAllocationTableEntry::attributes, ubixFSInfo::blockAllocationTable, vfs_mountPoint::fsInfo, fileDescriptor::mp, blockAllocationTableEntry::nextBlock, and syncBat().

| int getFreeBlocks | ( | int | count, |
| fileDescriptor_t * | fd | ||
| ) |
Definition at line 95 of file block.c.
References blockAllocationTableEntry::attributes, ubixFSInfo::batEntries, ubixFSInfo::blockAllocationTable, vfs_mountPoint::fsInfo, fileDescriptor::mp, blockAllocationTableEntry::nextBlock, and syncBat().
Referenced by ubixFSmkDir(), and writeUbixFS().

| int readFile | ( | char * | file | ) |
| int readUbixFS | ( | fileDescriptor_t * | fd, |
| char * | data, | ||
| uInt32 | , | ||
| long | size | ||
| ) |
Definition at line 192 of file ubixfs.c.
References assert, buffer, fileDescriptor::cacheNode, fdEof, vfs_mountPoint::fsInfo, cacheNode::info, kpanic(), fileDescriptor::mp, NULL, cacheNode::present, fileDescriptor::size, and fileDescriptor::status.
Referenced by addDirEntry(), and ubixfs_init().

| void syncBat | ( | struct vfs_mountPoint * | mp | ) |
Definition at line 73 of file block.c.
References ubixFSInfo::blockAllocationTable, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, vfs_mountPoint::fsInfo, device_interface::info, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pBatSize, ubixDiskLabel::ubixPartitions::pOffset, and device_interface::write.
Referenced by freeBlocks(), and getFreeBlocks().
| int ubixfs_init | ( | ) |
Definition at line 450 of file ubixfs.c.
References NULL, readUbixFS(), ubixfs_initialize(), and writeUbixFS().

| int ubixfs_initialize | ( | ) |
| void ubixfs_thread | ( | ) |
| dirList_t ubixFSLoadDir | ( | char * | ) |
Definition at line 39 of file directory.c.
References directoryList::dirName, kmalloc(), and sprintf().

| int ubixFSmkDir | ( | char * | dir, |
| fileDescriptor_t * | fd | ||
| ) |
Definition at line 92 of file directory.c.
References addDirEntry(), directoryEntry::attributes, ubixFSInfo::blockAllocationTable, blockSize, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, directoryEntry::fileName, vfs_mountPoint::fsInfo, getFreeBlocks(), device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, vfs_mountPoint::partition, ubixDiskLabel::partitions, directoryEntry::permissions, ubixDiskLabel::ubixPartitions::pOffset, blockAllocationTableEntry::realSector, directoryEntry::size, sprintf(), directoryEntry::startCluster, typeDirectory, UBIXFS_BLOCKSIZE_BYTES, and device_interface::write.

| void ubixFSUnlink | ( | char * | path, |
| struct vfs_mountPoint * | mp | ||
| ) |
| int writeFileByte | ( | int | ch, |
| fileDescriptor_t * | fd, | ||
| long | offset | ||
| ) |
Definition at line 116 of file ubixfs.c.
References assert, blockAllocationTableEntry::attributes, ubixFSInfo::batEntries, ubixFSInfo::blockAllocationTable, fileDescriptor::buffer, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, fdOpen, fdRead, fileDescriptor::fileName, directoryEntry::fileName, vfs_mountPoint::fsInfo, device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, blockAllocationTableEntry::nextBlock, NULL, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pBatSize, ubixDiskLabel::ubixPartitions::pOffset, device_interface::read, blockAllocationTableEntry::realSector, fileDescriptor::size, directoryEntry::size, fileDescriptor::start, fileDescriptor::status, strcmp(), and device_interface::write.

| int writeUbixFS | ( | fileDescriptor_t * | fd, |
| char * | data, | ||
| long | offset, | ||
| long | size | ||
| ) |
Definition at line 229 of file ubixfs.c.
References assert, ubixFSInfo::blockAllocationTable, blockSize, fileDescriptor::buffer, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, EOBC, fileDescriptor::fileName, directoryEntry::fileName, vfs_mountPoint::fsInfo, getFreeBlocks(), device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, blockAllocationTableEntry::nextBlock, NULL, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pOffset, device_interface::read, blockAllocationTableEntry::realSector, fileDescriptor::size, directoryEntry::size, fileDescriptor::start, directoryEntry::startCluster, strcmp(), and device_interface::write.
Referenced by addDirEntry(), and ubixfs_init().
