|
Basic Solution File System - BSFS
|
Public interface and documentation for the BSFS formatter tool. More...
Functions | |
| int | mkfs_bsfs_format_open (FILE *disk) |
| Format an already opened partition file as a BSFS filesystem. | |
| int | mkfs_bsfs_format_path (const char *path) |
Format a partition file located at path as a BSFS filesystem. | |
Public interface and documentation for the BSFS formatter tool.
This header documents the formatter utility that creates a BSFS filesystem image over a regular file (e.g., produced by dd). The formatter writes the superblock, initializes the block bitmap as a linked list of bitmap blocks, reserves metadata blocks, initializes the inode B-tree, creates a fresh root directory B-tree with "." and ".." entries, and persists the root inode (number 1 by convention).
The canonical binary built by this project is mkfs.bsfs, which accepts the path to a partition file as its single argument.
Example:
| int mkfs_bsfs_format_open | ( | FILE * | disk | ) |
Format an already opened partition file as a BSFS filesystem.
This function expects the file size to be a multiple of the block size (4096 bytes). It computes the on-disk layout, writes the superblock, initializes and persists the bitmap, ensures the inode B-tree exists, creates the root directory entries ("." and ".."), and writes the root inode into the inode B-tree. On success, the file is a valid BSFS image.
| disk | Opened FILE* corresponding to the partition image (opened in read/write mode). |
| int mkfs_bsfs_format_path | ( | const char * | path | ) |
Format a partition file located at path as a BSFS filesystem.
Opens the target file in read/write mode and delegates to mkfs_bsfs_format_open(). The file must already exist and its size must be a multiple of 4096 bytes.
| path | Path to the pre-sized partition file. |