arcbox-fs
High-performance filesystem service for ArcBox.
Overview
This crate implements VirtioFS-based file sharing between host and guest, providing near-native file I/O performance. It handles FUSE protocol requests from the guest and maps them to host filesystem operations.
Features
- Zero-copy I/O: Direct memory mapping when possible
- Parallel I/O: Concurrent request handling with multiple worker threads
- Intelligent caching: Negative cache for "file not found" results
- FUSE protocol: Compatible with standard virtiofs drivers
- Passthrough filesystem: Direct mapping of guest operations to host
Architecture
Guest: mount -t virtiofs arcbox /mnt/arcbox
|
v
+------------------------------------------+
| arcbox-fs |
| +------------------------------------+ |
| | FuseDispatcher | |
| | - Request parsing | |
| | - Reply handling | |
| +------------------------------------+ |
| +------------------------------------+ |
| | PassthroughFs | |
| | - Direct host filesystem access | |
| | - File handle management | |
| +------------------------------------+ |
| +------------------------------------+ |
| | NegativeCache | |
| | - Caches non-existent paths | |
| +------------------------------------+ |
+------------------------------------------+
Usage
use ;
let config = FsConfig ;
let fs = new?;
let dispatcher = new;
Performance Optimizations
- Negative caching: Avoids repeated stat() calls on non-existent paths (effective for node_modules, .git)
- Handle reuse: Keeps file handles open for frequently accessed files
- Readahead: Prefetches sequential reads
- Write combining: Batches small writes
License
MIT OR Apache-2.0