Expand description
Distributed filesystem abstraction backed by leased block storage.
grafos-fs provides a practical filesystem subset (open, read, write,
seek, readdir) on top of BlockLease storage obtained through the
fabricBIOS data plane. Files larger than a configurable stripe threshold
are automatically striped across multiple block leases for parallel I/O.
§On-block format
Block 0: Superblock (magic "GFFS", version 1, layout offsets)
Blocks 1..B: Free block bitmap (1 bit per block, packed)
Blocks B..I: Inode table (fixed-size inode records)
Blocks I..N: Data blocks§Quick start
use grafos_fs::{FabricFs, OpenFlags};
use grafos_std::block::BlockBuilder;
let lease = BlockBuilder::new().min_blocks(2048).acquire()?;
let mut fs = FabricFs::format(vec![lease])?;
let mut fh = fs.create("/hello.txt")?;
fs.write(&mut fh, b"hello fabric")?;
fs.close(fh)?;
let fh = fs.open("/hello.txt", OpenFlags::Read)?;
let mut buf = [0u8; 12];
let n = fs.read(&fh, &mut buf)?;
assert_eq!(&buf[..n], b"hello fabric");Structs§
- DirEntry
- Directory entry stored in directory data blocks.
- Fabric
Fs - Distributed filesystem backed by leased block storage.
- File
Handle - Handle to an open file.
- File
Stat - File metadata returned by stat().