Expand description
9P2000.L wire protocol with owned and allocation-free codecs.
Shared by the ZeroFS 9P server and the ninep-client crate so both sides
speak the exact same messages. Includes the ZeroFS-private Trebind/Rrebind
reconnect extension.
All supported messages use slice_codec. It encodes into caller-owned
buffers and decodes borrowed views without allocating. The owned API uses
Bytes storage, so decoded strings and payloads share the received frame.
With default features disabled, the codec requires only core. The owned
feature adds the userspace API in no_std + alloc environments.
Re-exports§
pub use slice_codec::CodecError;pub use slice_codec::LockType;pub use crate::slice_codec::lock_range_end;
Modules§
- message_
type - 9P2000.L and ZeroFS-private message identifiers.
- retry
- Mutation retry timings shared by 9P clients and servers.
- slice_
codec - Allocation-free 9P codec shared by the server, userspace, and kernel clients.
Structs§
- DirEntry
- DirEntry
Plus - Mutation
Envelope - Idempotency and HA-origin fields carried by a ZeroFS mutation.
- P9Message
- An owned 9P frame.
- Qid
- A ZeroFS inode identity.
- Rattach
- Rclunk
- Rfallocate
- Rflush
- Rfsync
- Rgetattr
- Attributes for a fid, with the mask of fields the server answered.
- Rgetlineage
- Durability lineage and the active HA writer epoch.
- Rgetlock
- Rlcreate
- Rlcreateattr
- Post-operation stat of a created and opened regular file.
- Rlerror
- A failed request’s Linux errno.
- Rlink
- Rlinkattr
- Rlock
- Outcome of a lock request, as the raw wire byte. Map it with
LockStatus::from_wire. - Rlopen
- Standard open reply layout, also used on the wire by private
Rlopenat. - Rlopenat
- Rlopenatread
- Rmkdir
- Rmkdirattr
- Rmknod
- Rmknodattr
- Rread
- Rreaddir
- Rreaddirattr
- Rreadlink
- Rrebind
- Identity of a fid rebound by inode id.
- Rrename
- Rrenameat
- Rsetattr
- Rsetattrattr
- Rstatfs
- Remote filesystem capacity and limits.
- Rsymlink
- Rsymlinkattr
- Runlinkat
- Rversion
- Rwalk
- Rwalkgetattr
- Rwrite
- Bytes accepted by a write.
- Rxattrwalk
- Stat
- Attributes returned by ZeroFS.
- Tattach
- Tclunk
- Tfallocate
- ZeroFS-private atomic fallocate request.
- Tflush
- Tfsync
- Tfsyncdur
- Durability-verified fsync carrying the oldest unverified lineage token.
datasynccontainsP9_FSYNC_*flags; withoutP9_FSYNC_INODEthe barrier is filesystem-wide. Token zero denotes no pending mutation in that scope. A lineage mismatch returnsESTALE. - Tgetattr
- Tgetlineage
- Queries the connection’s durability lineage and writer epoch.
- Tgetlock
- Tlcreate
- Tlcreateattr
- Tlink
- Tlock
- Tlopen
- Tlopenat
- Tlopenatread
- Tmkdir
- Tmknod
- Tread
- Treaddir
- Treaddirattr
- Treadlink
- Trebind
- Trename
- Trenameat
- Tsetattr
- Tstatfs
- Tsymlink
- Tunlinkat
- Tversion
- Twalk
- Twalkgetattr
- Twrite
- Txattrwalk
- Wire
Bytes - A variable-length byte field whose length is carried by its enclosing message.
- Wire
String - A length-prefixed 9P string using caller-selected byte storage.
Enums§
- Fallocate
Kind - Supported semantic operation encoded by the Linux fallocate mode bits.
- Lock
Status - Outcome of a
Tlockrequest. - Message
Constants§
- FALLOC_
FL_ KEEP_ SIZE - FALLOC_
FL_ PUNCH_ HOLE - FALLOC_
FL_ ZERO_ RANGE - GETATTR_
ALL - NOFID
- P9_
CHANNEL_ SIZE - P9_
COUNT_ FIELD_ LEN - P9_
DEBUG_ BUFFER_ SIZE - P9_
ENOTLEADER - P9_
ENOTLEADER_ CLEAN - P9_
EOPIDSTALE - P9_
FSYNC_ DATASYNC - Standard data-only durability request bit. ZeroFS currently performs the same full durability barrier whether this compatibility bit is set or not.
- P9_
FSYNC_ INODE Tfsyncdur.datasynclimits the verified barrier to the inode named by its fid. Without this flag the barrier is filesystem-wide, preserving compatibility with clients that predate scoped verified fsync.- P9_
FSYNC_ KNOWN_ FLAGS - P9_
HEADER_ SIZE - P9_
IOHDRSZ - P9_
LOCK_ FLAGS_ BLOCK - P9_
MAX_ GROUPS - P9_
MAX_ MSIZE - P9_
MAX_ NAME_ LEN - P9_
MIN_ MESSAGE_ SIZE - P9_
NOBODY_ UID - P9_
OP_ ENVELOPE_ LEN - P9_
OP_ FLAGS_ LEN - P9_
OP_ FLAG_ RETRY - P9_
OP_ ID_ LEN - P9_
OP_ KNOWN_ FLAGS - P9_
OP_ ORIGIN_ EPOCH_ LEN - P9_
READDIR_ BATCH_ SIZE - P9_
REBIND_ CREDENTIAL_ GROUPS_ INCOMPLETE - High bit of the credential group-count byte. The sender supplied the primary gid, could not encode the complete supplementary-group list, and already performed the caller’s group DAC check locally.
- P9_
REBIND_ CREDENTIAL_ HEADER_ SIZE - P9_
REBIND_ CREDENTIAL_ MAX_ SIZE - P9_
REBIND_ CREDENTIAL_ SENTINEL - P9_
REBIND_ CREDENTIAL_ VERSION - P9_
REBIND_ KNOWN_ FLAGS - P9_
REBIND_ OPENED - P9_
REBIND_ REPLAY - P9_
RLOPENATREAD_ HDR - P9_
SIZE_ FIELD_ LEN - P9_
TAG_ FIELD_ LEN - P9_
TWRITE_ HDR - P9_
TYPE_ FIELD_ LEN - QID_
TYPE_ DIR - QID_
TYPE_ FILE - QID_
TYPE_ SYMLINK - R_
FALLOCATE - SETATTR_
ATIME - SETATTR_
ATIME_ ACCESS - ZeroFS extension: persist an atime selected by the server for a successful VFS access without treating it as an explicit metadata change.
- SETATTR_
ATIME_ SET - SETATTR_
CTIME - Accepted and ignored: every mutation stamps ctime from the server clock, and the Linux 9p client sets this bit alongside mode, owner and size changes.
- SETATTR_
GID - SETATTR_
KNOWN - SETATTR_
MODE - SETATTR_
MTIME - SETATTR_
MTIME_ SET - SETATTR_
SIZE - SETATTR_
UID - T_
FALLOCATE - T_
LCREATE - T_
LCREATEATTR - T_LINK
- T_
LINKATTR - T_MKDIR
- T_
MKDIRATTR - T_MKNOD
- T_
MKNODATTR - T_
RENAME - T_
RENAMEAT - T_
SETATTR - T_
SETATTRATTR - T_
SYMLINK - T_
SYMLINKATTR - T_
UNLINKAT - T_WRITE
- VERSION_
9P2000L - VERSION_
9P2000L_ ZEROFS
Traits§
- Byte
Storage - Storage backing a variable-length wire field.
Functions§
- classify_
fallocate_ mode - Parse the exact fallocate mode combinations supported by ZeroFS.
- subtract_
lock_ range - Remove one range from another, returning the surviving left and right
fragments as
(start, length)pairs. A zero length extends to EOF.