I'm working on building a simple file system that can handle up to 2GB. My block sizes will be 1KB each and the maximum size file I will take in is 200MB. It will also store up to 10,000 files so I'm trying to lay out how many inode blocks and bitmap blocks to reserve, but I came up with a rough outline. This is how many I of each I plan on having:
Block 0: superblock
block 1: root inode block
blocks 3-182: bitmap blocks
blocks 183-1091: inode blocks
blocks 1092-10000: data blocks for storing files
But again this is an estimate. From the documents I've read about building a simple file system, they never mention specifics such as how many of each you will need. Could someone point me in the right direction? Edit: this is my current inode structure and directory entry structure:
struct inode{
unsigned long num; //inode number
unsigned long parent_inode; //parent inode number
unsigned long zonelist[10]; //pointers: 7 direct, 1 indirect, 1 dub. ind, 1 trip. ind
char padding[(BLOCKSIZE - (sizeof(long)*14 + sizeof(char) * MAX_FILE_NAME_LENGTH))]; //padding for a BLOCKSIZE inode struct
};
struct dir_entry{
char name[MAX_FILE_NAME_LENGTH]; //name of file or directory
int fileinode[100]; //inode pointer
unsigned long isdir; //0 = file, 1 = directory
unsigned long size; //file size in bytes
int num_of_files; //file counter
};