SimpleFS
A Simple File Sytem implementation including Disk and Shell Layers
|
Interface for the FileSystem layer. More...
Go to the source code of this file.
Classes | |
class | FileSystem |
FileSytem Class. Contains fs layer to access and store disk blocks. Used by sfssh (shell) to provide access to the end-user. More... | |
struct | FileSystem::SuperBlock |
SuperBlock structure. It is the first block in any disk. It's main function is to help validating the disk. Contains metadata of the disk. More... | |
struct | FileSystem::Dirent |
Directory Entry. Contains necessary fields to locate the file and directory Consumes 64 KB per object. Used to store information about a directory. More... | |
struct | FileSystem::Directory |
Directory Structure. Contains a table of directory entries for storing hierarchy. Also contains fields for Size and Valid bits. Name is matched against the one in Directory entry. Also, it is allocated from end for effectively using disk space. More... | |
struct | FileSystem::Inode |
Inode Structure Corresponds to a file stored on the disk. Contains the list of raw data blocks used to store the data. Stores the size of the file. More... | |
union | FileSystem::Block |
Block Union Corresponds to one block of disk of size Disk::BLOCKSIZE. Can be used as a SuperBlock, Inode, Pointers block, or raw Data block. More... | |
struct FileSystem::SuperBlock |
SuperBlock structure. It is the first block in any disk. It's main function is to help validating the disk. Contains metadata of the disk.
struct FileSystem::Dirent |
Directory Entry. Contains necessary fields to locate the file and directory Consumes 64 KB per object. Used to store information about a directory.
Class Members | ||
---|---|---|
uint32_t | inum |
valid bit to check if the entry is valid |
char | Name[NAMESIZE] |
inum for Inodes or offset for dir |
uint8_t | type | |
uint8_t | valid |
type = 1 for file, type = 0 for directory |
struct FileSystem::Directory |
Directory Structure. Contains a table of directory entries for storing hierarchy. Also contains fields for Size and Valid bits. Name is matched against the one in Directory entry. Also, it is allocated from end for effectively using disk space.
Class Members | ||
---|---|---|
uint32_t | inum |
Valid bit for validation |
char | Name[NAMESIZE] |
inum = block_num * DIR_PER_BLOCK + offset |
Dirent | Table[ENTRIES_PER_DIR] |
Directory Name |
uint16_t | Valid |
struct FileSystem::Inode |
Inode Structure Corresponds to a file stored on the disk. Contains the list of raw data blocks used to store the data. Stores the size of the file.
Class Members | ||
---|---|---|
uint32_t | Direct[FileSystem::POINTERS_PER_INODE] |
Size of file |
uint32_t | Indirect |
Direct pointers |
uint32_t | Size |
Whether or not inode is valid |
uint32_t | Valid |
union FileSystem::Block |
Block Union Corresponds to one block of disk of size Disk::BLOCKSIZE. Can be used as a SuperBlock, Inode, Pointers block, or raw Data block.
Class Members | ||
---|---|---|
char | Data[Disk::BLOCK_SIZE] |
Contains indexes of Direct Blocks. 0 if null.ck |
struct Directory | Directories[FileSystem::DIR_PER_BLOCK] |
Data block |
struct Inode | Inodes[FileSystem::INODES_PER_BLOCK] | |
uint32_t | Pointers[FileSystem::POINTERS_PER_BLOCK] |
Inode block |
struct SuperBlock | Super |