HelixFS
FileSystemOps trait, block device layer, journaling, snapshot API, and CoW semantics.
HelixFS — Virtual File System
The helix-fs crate provides HelixFS, a feature-rich virtual filesystem with POSIX-compatible operations, B+ tree indexing, write-ahead journaling, copy-on-write snapshots, per-extent compression, and file-level encryption. It's designed to be both a complete filesystem implementation and an extensible VFS layer.
Any module can implement the FileSystemOps trait to plug in a new filesystem — the VFS handles mount points, path resolution, and caching.
FileSystemOps Trait
This is the central VFS interface. Every filesystem implementation — HelixFS, tmpfs, procfs, devfs — implements this trait. The API uses inode numbers (not path strings), similar to FUSE/VFS internals, with Credentials passed to permission-sensitive operations.
Core Types
These are the fundamental types used across all filesystem operations. They're designed for zero-cost abstractions — newtype IDs prevent misuse, and bitflags provide type-safe option handling.
Operation Builders
For complex I/O patterns, HelixFS provides typed operation builders with fluent APIs. These allow fine-grained control over priority, synchronization, and buffering without overloading function signatures.
Block Device Trait
The block device trait is the low-level interface between the filesystem and storage hardware. Any block storage — NVMe, virtio-blk, RAM disk — implements this trait.
HelixFS Features
HelixFS is not just a VFS layer — it's a full-featured on-disk filesystem with modern capabilities.
| Feature | Description |
|---|---|
| B+ Tree Indexing | All directories and extent maps use B+ trees for O(log n) lookups |
| Write-Ahead Journal | Crash-safe metadata with ordered, writeback, and full journal modes |
| CoW Snapshots | Instant O(1) snapshots with copy-on-write — zero data copying |
| Per-Extent Compression | LZ4, ZSTD, or LZO compression at the extent level |
| File Encryption | AES-256-XTS encryption with per-file key management |
| Extent Mapping | Contiguous block groups for sequential I/O performance |
| Free-Space Trees | B+ tree allocator with group allocation for locality |
Journal API
The journal provides crash consistency. Every metadata change goes through the journal, so the filesystem can recover to a consistent state after an unexpected shutdown.
Snapshot API
Snapshots use copy-on-write semantics — creating a snapshot is O(1) and costs zero data copying. Blocks are shared between the live filesystem and the snapshot until one side writes, at which point a new copy is allocated.
HelixFS snapshots form a tree — you can snapshot a snapshot. The
diff_snapshotsmethod lets you see exactly which files changed between any two points in the tree, making it easy to implement incremental backups or rollback.