libfs native exFAT filesystem

Native C++ exFAT implementation with Qt6 integration

libfs provides a native C++ exFAT filesystem implementation with full Qt6 integration, used as the storage layer for hive encrypted volumes.

Features

  • Native C++ Implementation - No external C library dependencies (replaces legacy FatFS)
  • Qt6 Integration - Transparent access via QFile, QDir, and standard Qt file APIs
  • Sector Caching - CLOCK-based cache for efficient I/O on block devices
  • File Locking - Concurrent access protection for multi-threaded use
  • Fast Seek - Cluster map for O(1) random access within large files
  • Defragmentation - Online defrag support for long-lived volumes
  • TRIM Support - Sector discard for flash-based storage backends
  • Filesystem Checker - ExFatChecker (fsck) for consistency verification and repair
  • Testing Tools - Corruptifier for fault injection and chaos testing

Architecture

Application Layer (QFile, QDir)
         |
   ExFatFileEngine (Qt integration)
         |
   ExFatFilesystem (core operations)
         |
   SectorCache (CLOCK algorithm)
         |
   BlockDevice interface
    /          \
FileBlockDevice   EncryptedBlockDevice
 (plain file)      (AES-XTS layer)

Usage

libfs is used internally by the hive storage system. Applications access hive files through standard Qt APIs:

// Files on a mounted hive volume are accessed transparently
QFile file("hivecluster-0:/path/to/file.txt");
if (file.open(QIODevice::ReadWrite)) {
    file.write("Hello from hive storage");
}

Test Coverage

467 tests covering core filesystem operations (240), fsck (39), Qt integration (45), chaos/fault injection (54), and cache behavior (35).

  • Hive Encryption - Encryption layer that sits below exFAT
  • Name Generation - Hive display name generation
Topics
reference libfs filesystem exfat