|
Basic Solution File System - BSFS
|
Formatter utility for the BSFS filesystem image. 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. | |
| int | main (int argc, char **argv) |
| Program entry point for mkfs.bsfs. | |
Formatter utility for the BSFS filesystem image.
Formats a regular file (e.g., created with dd) into a BSFS filesystem image. The on-disk layout initialized by this tool is:
The formatter writes and persists the superblock, initializes the block bitmap linked list, reserves metadata blocks in the bitmap, initializes the inode B-tree (persisting its root in the superblock if created), creates a fresh directory B-tree for the filesystem root, inserts "." and ".." entries, and finally persists the root inode into the inode B-tree.
Usage: mkfs.bsfs <partition_file>
| int main | ( | int | argc, |
| char ** | argv ) |
Program entry point for mkfs.bsfs.
Usage: mkfs.bsfs <partition_file>
| argc | Argument count. |
| argv | Argument vector. |
| 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. |