fuser-iouring
A Rust library for writing FUSE filesystems, with all communication with the kernel going through io_uring.
Why
Libraries such as fuser talk to the kernel using blocking read(2) and write(2) calls on /dev/fuse. Each request costs at least two syscalls, and the event loop is built around a blocking model.
fuser-iouring sends those reads and writes through an io_uring submission queue instead. That gives you a foundation for batching, fewer context switches, and moving toward the kernel's native FUSE-over-io_uring transport, without changing how you write a filesystem.
Status: under development. The API is not yet stable, and some operations (xattrs,
fsync,release,forget, locks) are not dispatched yet.
Requirements
- Linux 5.6 or newer (for
io_uring) fusermountavailable onPATH(shipped withfuse/fuse3)
Quick start
or add it to Cargo.toml manually:
[]
= "0.1.2"
use ;
use FuseAttrOut;
;
mount blocks until the filesystem is unmounted.
API
The API follows fuser closely, so moving between the two is straightforward:
- Implement the
FileSystemtrait. Each method maps to one FUSE operation (lookup,getattr,read,write,readdir, and so on), and any method you don't override returnsENOSYS. - Return
Ok(reply)orErr(errno). Results are returned directly, rather than throughfuser's reply objects. - Call
fuser_iouring::mount(fs, mountpoint, options)to mount and run the event loop. - Raw kernel ABI structs and constants live in
fuser_iouring::ll::fuse_abi.
Full reference: docs.rs/fuser-iouring.
Examples
| Example | Description |
|---|---|
init |
Minimal filesystem that only completes FUSE_INIT |
simple |
In-memory style filesystem persisted to a data dir |
passthrough |
Mirrors an existing directory |
License
Licensed under the Apache License, Version 2.0.