Block-based data store with journal support Implements a mix between a block-based file system structure and a doubly-linked list.
Disk layout of the allocation table :
blockCount | 4 bytes (int) | Number of blocks in store blockSize | 4 bytes (int) | Size of a storage block firstClusterIndex | 4 bytes (int) | Index of the first block allocationTable (*blockCount allocation entries) flags | 1 byte | Flags indicating the block usage allocatedSize | 4 bytes (int) | Size of the actual data stored in this block previousClusterIndex | 4 bytes (int) | Index of the previous block nextClusterIndex | 4 bytes (int) | Index of the next block
Disk layout of the data store :
blocks (*blockCount blocks of size blockSize)
Computing a block offset from its index :
blockOffset = blockIndex*blockSize