vnfs 0.0.3

Vectorized NFS client API in Rust
docs.rs failed to build vnfs-0.0.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

vnfs

A vectorized NFSv4.1 client library written in Rust.

NFSv4 supports compounds that coalesce many small file operations into one round trip, which can dramatically cut network latency for metadata-heavy workloads. The POSIX file API cannot use this, so vnfs exposes a vectorized VecFs API (the idea from the FAST'17 paper vNFS: Maximizing NFS Performance with Compounds and Vectorized I/O) as a Rust crate.

Backends

The crate is backend-agnostic through the VecFs trait:

  • NfsVecFs — an NFSv4.1 implementation on top of libntirpc, batching many operations (lookups, readdirs, getattrs, opens, reads, ...) into few large compounds.
  • DummyVecFs — a std::fs-backed implementation so the same API also works on non-NFS filesystems (and is handy for tests).

Example

use vnfs::{VecFs, AttrMask};

fn main() -> vnfs::VfResult<()> {
    let mut fs = vnfs::nfs::NfsVecFs::connect("127.0.0.1")?;

    // Attributes to fetch for each entry (all supported fields).
    let masks = AttrMask::all();

    // List a directory's children in one batched round trip.
    let entries = fs.listdir("/export", masks, 0, false)?;
    for e in entries {
        let path = e.file.path.unwrap_or_default();
        println!("{} (ftype={})", path.display(), e.ftype);
    }
    Ok(())
}

License

Licensed under either of

  • Apache License, Version 2.0
  • MIT license

at your option.