sofs19
0.1
FUSE based file system
|
Disk abstraction layer. More...
Functions | |
void | soOpenDisk (const char *devname) |
Open disk at sofs19 abstraction level. More... | |
void | soCloseDisk () |
Close disk at sofs19 abstraction level. More... | |
void | soOpenSuperBlock () |
Open the superblock dealer. More... | |
void | soCloseSuperBlock () |
Close the superblock dealer. More... | |
void | soSaveSuperBlock () |
Save superblock to disk. More... | |
SOSuperBlock * | soGetSuperBlockPointer () |
Get a pointer to the superblock. More... | |
void | soOpenInodeTable () |
Open inode table dealer. More... | |
void | soCloseInodeTable () |
Close the inode table dealer. More... | |
int | soOpenInode (uint32_t in) |
open inode More... | |
void | soCheckInodeHandler (int ih, const char *funcname=__FUNCTION__) |
Check given handler, throwing an exception in case of error. More... | |
SOInode * | soGetInodePointer (int ih) |
get pointer to an open inode More... | |
void | soSaveInode (int ih) |
Save an open inode to disk. More... | |
void | soCloseInode (int ih) |
Close an open inode. More... | |
uint32_t | soGetInodeNumber (int ih) |
Return the number of the inode associated to the given handler. More... | |
bool | soCheckInodeAccess (int ih, int access) |
check an open inode against a requested access More... | |
void | soReadDataBlock (uint32_t bn, void *buf) |
Read a block of the data zone. More... | |
void | soWriteDataBlock (uint32_t bn, void *buf) |
Write a block of the data zone. More... | |
Disk abstraction layer.
This layer is used to prevent higher level functions from access disk blocks at raw level.
void sofs19::soOpenDisk | ( | const char * | devname | ) |
Open disk at sofs19 abstraction level.
Open disk at raw level and then open superblok (SB) and inode table (IT) abstraction modules. The other sofs19 abstraction modules do not need to be initialized. They are: free inode list table (FILT) module, free block list table (FBLT) module, and data zone (DZ) module.
void sofs19::soCloseDisk | ( | ) |
Close disk at sofs19 abstraction level.
First close sofs19 abstraction modules and then close disk at raw level.
void sofs19::soOpenSuperBlock | ( | ) |
Open the superblock dealer.
Prepare the internal data structure of the superblock dealer
void sofs19::soCloseSuperBlock | ( | ) |
Close the superblock dealer.
Save superblock to disk and close dealer Do nothing if not loaded
void sofs19::soSaveSuperBlock | ( | ) |
Save superblock to disk.
Do nothing if not loaded
SOSuperBlock* sofs19::soGetSuperBlockPointer | ( | ) |
Get a pointer to the superblock.
Load the superblock, if not done yet
void sofs19::soOpenInodeTable | ( | ) |
Open inode table dealer.
Prepare the internal data structure for the inode table dealer
void sofs19::soCloseInodeTable | ( | ) |
Close the inode table dealer.
Save to disk all openning inodes and close dealer
int sofs19::soOpenInode | ( | uint32_t | in | ) |
open inode
If inode is already open, just increment usecount; otherwise, transfer the inode from disk and put usecount at 1.
in | the number of the inode to open |
void sofs19::soCheckInodeHandler | ( | int | ih, |
const char * | funcname = __FUNCTION__ |
||
) |
Check given handler, throwing an exception in case of error.
ih | the handler to be checked |
funcname | name of the function making the ckeck |
SOInode* sofs19::soGetInodePointer | ( | int | ih | ) |
get pointer to an open inode
A pointer to the SOInode structured where the inode is loaded is returned.
ih | inode handler |
void sofs19::soSaveInode | ( | int | ih | ) |
Save an open inode to disk.
The inode is not closed.
ih | inode handler |
void sofs19::soCloseInode | ( | int | ih | ) |
Close an open inode.
Decrement usecount of given inode, releasing slot if 0 is reached.
ih | inode handler |
uint32_t sofs19::soGetInodeNumber | ( | int | ih | ) |
Return the number of the inode associated to the given handler.
ih | inode handler |
bool sofs19::soCheckInodeAccess | ( | int | ih, |
int | access | ||
) |
check an open inode against a requested access
access is a bitwise OR of one or more of R_OK, W_OK, and X_OK
ih | inode handler |
access | requested access |
void sofs19::soReadDataBlock | ( | uint32_t | bn, |
void * | buf | ||
) |
Read a block of the data zone.
[in] | bn | number of block to be read |
[in] | buf | pointer to the buffer where the data must be read into |
void sofs19::soWriteDataBlock | ( | uint32_t | bn, |
void * | buf | ||
) |
Write a block of the data zone.
[in] | bn | number of block to be read |
[in] | buf | pointer to the buffer where the data must be written from |