sofs19
0.1
FUSE based file system
|
Functions to manage the list of free inodes and the list of free blocks. More...
Functions | |
uint32_t | soAllocInode (uint32_t type, uint32_t perm) |
Allocate a free inode. More... | |
void | soFreeInode (uint32_t in) |
Free the referenced inode. More... | |
uint32_t | soAllocDataBlock () |
Allocate a free data block. More... | |
void | soFreeDataBlock (uint32_t bn) |
Free the referenced data block. More... | |
void | soReplenishHeadCache () |
Replenish the head cache. More... | |
void | soDepleteTailCache () |
Deplete the tail cache. More... | |
Functions to manage the list of free inodes and the list of free blocks.
SOException
. uint32_t sofs19::soAllocInode | ( | uint32_t | type, |
uint32_t | perm | ||
) |
Allocate a free inode.
An inode is retrieved from the list of free inodes and is properly initialized.
[in] | type | the inode type |
[in] | perm | permissions of the newly allocated inode |
type
must represent either a file (S_IFREG
), a directory (S_IFDIR
), or a symbolic link (S_IFLNK
); if not, error EINVAL
is thrown; EINVAL
is thrown; ENOSPC
is thrown; so
is used.void sofs19::soFreeInode | ( | uint32_t | in | ) |
Free the referenced inode.
The inode is cleaned, marked as free, and inserted into the list of free inodes:
[in] | in | number (reference) of the inode to be freed |
so
is used. uint32_t sofs19::soAllocDataBlock | ( | ) |
Allocate a free data block.
A data block reference is retrieved from the head cache:
ENOSPC
is thrown; so
is used.void sofs19::soFreeDataBlock | ( | uint32_t | bn | ) |
Free the referenced data block.
The data block reference is inserted into the tail cache:
bn | the number (reference) of the data block to be freed |
so
is used. void sofs19::soReplenishHeadCache | ( | ) |
Replenish the head cache.
References to free data blocks should be transferred from the head reference data block or from the tail cache, if no reference data blocks exist, to the head cache:
head_blk
field of the superblock; so
is used. void sofs19::soDepleteTailCache | ( | ) |
Deplete the tail cache.
References to free data blocks should be transferred from the tail cache to the tail reference data block.
tail_blk
field of the superblock; so
is used.