ubixfs.c File Reference

#include <ubixfs/ubixfs.h>
#include <ubixfs/dirCache.h>
#include <vfs/vfs.h>
#include <ubixos/types.h>
#include <ubixos/sched.h>
#include <ubixos/kpanic.h>
#include <ubixos/exec.h>
#include <lib/kmalloc.h>
#include <lib/string.h>
#include <lib/kprintf.h>
#include <assert.h>

Go to the source code of this file.

Functions

static int openFileUbixFS (const char *file, fileDescriptor *fd)
int readUbixFS (fileDescriptor *fd, char *data, uInt32 offset, long size)
int ubixfs_init ()
int ubixfs_initialize (vfs_mountPoint_t *mp)
static int ubixfs_loadData (fileDescriptor *fd, char *data, uInt32 size, uInt32 batIndex)
void ubixFSUnlink (char *path, vfs_mountPoint_t *mp)
int writeFileByte (int ch, fileDescriptor *fd, long offset)
int writeUbixFS (fileDescriptor *fd, char *data, long offset, long size)


Function Documentation

static int openFileUbixFS ( const char *  file,
fileDescriptor fd 
) [static]

Definition at line 46 of file ubixfs.c.

References assert, ubixFSInfo::dirCache, fileRead, fileWrite, cacheNode::info, kmalloc(), kprintf(), NULL, cacheNode::permissions, cacheNode::present, fileDescriptor::size, cacheNode::size, cacheNode::startCluster, UBIXFS_ALIGN, ubixfs_cacheFind(), ubixfs_loadData(), and x1.

Referenced by ubixfs_init().

int readUbixFS ( fileDescriptor fd,
char *  data,
uInt32  offset,
long  size 
)

Definition at line 194 of file ubixfs.c.

References assert, buffer, fdEof, kpanic(), NULL, and fileDescriptor::size.

Referenced by addDirEntry(), and ubixfs_init().

int ubixfs_init (  ) 

Definition at line 456 of file ubixfs.c.

References kpanic(), NULL, openFileUbixFS(), readUbixFS(), ubixfs_initialize(), ubixFSmkDir(), ubixFSUnlink(), vfsRegisterFS(), writeUbixFS(), and x1.

int ubixfs_initialize ( vfs_mountPoint_t mp  ) 

Definition at line 376 of file ubixfs.c.

References assert, cacheNode::attributes, ubixFSInfo::batEntries, ubixFSInfo::blockAllocationTable, vfs_mountPoint::device, device_node::devInfo, ubixFSInfo::dirCache, vfs_mountPoint::diskLabel, vfs_mountPoint::fsInfo, cacheNode::info, device_interface::info, kmalloc(), kprintf(), ubixDiskLabel::magicNum, ubixDiskLabel::magicNum2, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pBatSize, cacheNode::permissions, cacheNode::present, device_interface::read, ubixFSInfo::rootDir, cacheNode::size, cacheNode::startCluster, UBIXDISKMAGIC, ubixfs_cacheNew(), and x1.

static int ubixfs_loadData ( fileDescriptor fd,
char *  data,
uInt32  size,
uInt32  batIndex 
) [static]

Definition at line 341 of file ubixfs.c.

References assert, ubixFSInfo::blockAllocationTable, blockSize, blockAllocationTableEntry::nextBlock, NULL, blockAllocationTableEntry::realSector, UBIXFS_ALIGN, and UBIXFS_BLOCKSIZE_BYTES.

Referenced by openFileUbixFS().

void ubixFSUnlink ( char *  path,
vfs_mountPoint_t mp 
)

Definition at line 309 of file ubixfs.c.

References ubixFSInfo::blockAllocationTable, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, directoryEntry::fileName, vfs_mountPoint::fsInfo, device_interface::info, kmalloc(), kprintf(), vfs_mountPoint::partition, ubixDiskLabel::partitions, device_interface::read, ubixFSInfo::rootDir, strcmp(), typeDeleted, device_interface::write, and x1000.

Referenced by ubixfs_init().

int writeFileByte ( int  ch,
fileDescriptor fd,
long  offset 
)

Definition at line 118 of file ubixfs.c.

References assert, ubixFSInfo::blockAllocationTable, fdOpen, fdRead, blockAllocationTableEntry::nextBlock, and NULL.

int writeUbixFS ( fileDescriptor fd,
char *  data,
long  offset,
long  size 
)

Definition at line 232 of file ubixfs.c.

References assert, ubixFSInfo::blockAllocationTable, blockSize, EOBC, directoryEntry::fileName, getFreeBlocks(), kfree(), kmalloc(), blockAllocationTableEntry::nextBlock, NULL, blockAllocationTableEntry::realSector, directoryEntry::size, fileDescriptor::size, directoryEntry::startCluster, strcmp(), and x1000.

Referenced by addDirEntry(), and ubixfs_init().


Generated on Sun Dec 3 02:38:10 2006 for UbixOS V2 by  doxygen 1.4.7