How santhoshharsha375-afk/journalfs works
JournalFS is a C filesystem stored in a regular disk-image file, exposed through both a FUSE mount and a command-line driver. The principal workflow is a user operation entering the driver, reaching filesystem operations, and persisting metadata atomically through the WAL before applying it to the image. Mount-time recovery replays committed work; formatting, checking, checkpointing, and journal inspection are supporting product capabilities. Some subsystem links are documented by the README rather than shown in sampled implementation excerpts.
Main entry points: transaction.c Transaction Manager · disk.c Disk Image I/O · journal.c Write-Ahead Log · main.c CLI and Mount Driver
Components 14
User Interfaces
- CLI and Mount Driver
src/main.c - FUSE Operations
src/fuse_ops.c
Filesystem Core
- Filesystem Operations
src/filesystem.c - Image Format
include/journalfs.h
Durability
- Transaction Manager
src/transaction.c - Write-Ahead Log
src/journal.c - Crash Recovery
src/recovery.c - Journal Checkpointing
src/checkpoint.c - Disk Image I/O
src/disk.c
Image Tools
- Image Formatter
src/mkfs.c - FSCK Command
tools/fsck_journalfs.c - Consistency Checker
src/fsck.c - Journal Inspector
tools/journal_inspect.c
Other components
- User
Connections 17
- User → CLI and Mount Driver: issues operation
README.md - CLI and Mount Driver → Filesystem Operations: dispatches operations
src/main.c - CLI and Mount Driver → FUSE Operations: starts mount
README.md - FUSE Operations → Filesystem Operations: uses filesystem
README.md - Filesystem Operations → Transaction Manager: commits metadata
src/filesystem.c - Transaction Manager → Write-Ahead Log: writes WAL records
README.md - Transaction Manager → Disk Image I/O: applies home blocks
README.md - Transaction Manager → Crash Recovery: requests replay
README.md - Transaction Manager → Journal Checkpointing: reclaims journal slots
README.md - Crash Recovery → Write-Ahead Log: scans committed records
README.md - Crash Recovery → Disk Image I/O: replays updates
README.md - Journal Checkpointing → Write-Ahead Log: reclaims slots
README.md - Image Formatter → Disk Image I/O: creates image
README.md - FSCK Command → Consistency Checker: checks image
tools/fsck_journalfs.c - Consistency Checker → Disk Image I/O: reads image
README.md - Journal Inspector → Write-Ahead Log: reads records
tools/journal_inspect.c - Journal Inspector → Disk Image I/O: opens image
tools/journal_inspect.c