arcbox_virtio_fs/lib.rs
1//! `VirtIO` filesystem device (virtio-fs).
2//!
3//! This implements the high-performance shared filesystem using virtiofs
4//! protocol for host-guest file sharing.
5//!
6//! # Architecture
7//!
8//! ```text
9//! Guest Driver (virtio-fs)
10//! │
11//! ▼ (virtqueue)
12//! ┌─────────────────────────┐
13//! │ VirtioFs │
14//! │ ┌─────────────────┐ │
15//! │ │ FuseSession │ │
16//! │ │ - INIT state │ │
17//! │ │ - features │ │
18//! │ └─────────────────┘ │
19//! └───────────┬─────────────┘
20//! │ dispatch
21//! ▼
22//! FuseRequestHandler
23//! (implemented by arcbox-fs)
24//! ```
25//!
26//! ## Module layout
27//!
28//! - `protocol`: FUSE wire-protocol constants
29//! - `request`: `FuseRequest` / `FuseResponse` envelopes
30//! - `session`: `FuseSession` — INIT handshake + negotiated state
31//! - `handler`: `FuseRequestHandler` trait
32//! - `device`: `FsConfig`, `VirtioFs`, `VirtioDevice` impl
33
34#![allow(clippy::ptr_as_ptr)]
35#![allow(clippy::borrow_as_ptr)]
36#![allow(clippy::unnecessary_cast)]
37#![allow(clippy::cognitive_complexity)]
38#![allow(clippy::map_unwrap_or)]
39#![allow(clippy::useless_vec)]
40#![allow(clippy::unnecessary_wraps)]
41#![allow(clippy::redundant_clone)]
42#![allow(clippy::unnecessary_map_or)]
43#![allow(clippy::missing_fields_in_debug)]
44#![allow(clippy::needless_lifetimes)]
45#![allow(clippy::needless_collect)]
46#![allow(mismatched_lifetime_syntaxes)]
47#![allow(clippy::too_many_lines)]
48
49mod device;
50mod handler;
51mod protocol;
52mod request;
53mod session;
54
55pub use device::{FsConfig, VirtioFs};
56pub use handler::FuseRequestHandler;
57pub use protocol::{
58 DEFAULT_MAX_PAGES, DEFAULT_MAX_READAHEAD, DEFAULT_MAX_WRITE, FUSE_ASYNC_READ, FUSE_BIG_WRITES,
59 FUSE_CACHE_SYMLINKS, FUSE_KERNEL_MINOR_VERSION, FUSE_KERNEL_VERSION, FUSE_MAP_ALIGNMENT,
60 FUSE_PARALLEL_DIROPS, FUSE_WRITEBACK_CACHE,
61};
62pub use request::{FuseRequest, FuseResponse};
63pub use session::FuseSession;