Expand description
Server-side state: configuration, sessions, tree connects, open handles and directory-search contexts.
Per the architecture, shared metadata is refcounted (Arc) so an
IoContext can carry it for the lifetime of
one request without borrowing the connection lock.
Modules§
Structs§
- AppInstance
Table - Server-wide registry of application-instance opens: a later CREATE with the same AppInstanceId from a different client force-closes the prior open, enabling client failover ([MS-SMB2] §3.3.5.9.13).
- AppOpen 🔒
- A recorded application-instance open ([MS-SMB2] §3.3.5.9.13).
- Break
Crypto - Crypto material needed to sign/seal an unsolicited oplock break for a holder, snapshotted at grant time (mirrors the async completion path).
- Conn
State - Per-connection state machine.
- Durable
Entry - A durable file handle preserved across a connection drop so the client can
reclaim it ([MS-SMB2] §3.3.1.10). Stored as
Sendmetadata; on reconnect the file is re-opened (single-node model), so no live fd is held here. - Held
Lock 🔒 - Lease
Holder - A granted caching lease and the means to break it ([MS-SMB2] §2.2.23.2).
- Lease
Table - Server-wide lease table: the set of caching-lease holders per file path.
- Lock
Manager - Server-wide byte-range lock manager ([MS-SMB2] §2.2.26 / [MS-FSA] §2.1.4.10). Locks are keyed by the file’s on-disk path so opens from different connections contend correctly.
- Open
Mode 🔒 - One recorded open on a file: its granted access and the sharing it permits.
- Oplock
Holder - A granted exclusive oplock and the means to break it.
- Oplock
Table - Server-wide oplock table: at most one exclusive oplock per file path.
- Search
Ctx - Directory search continuation state keyed by search SID.
- Server
Shared - Global (per-process) server configuration and user database.
- Session
- An authenticated SMB session (one UID).
- Session
Entry - Established-session crypto material, shared server-wide so a new connection can bind another channel to the session ([MS-SMB2] §3.3.5.5.3 multichannel).
- Session
Table - Server-wide table of established sessions, keyed by session id.
- Share
- A published share backed by a VFS instance.
- Share
Mode Table - Server-wide table of open share modes, keyed by on-disk path, used to detect sharing violations ([MS-FSA] §2.1.5.1) across all connections.
Enums§
- AppInstance
Match - Outcome of matching a CREATE’s AppInstanceId against existing opens.
- Lease
AckError - Why a lease-break acknowledgment was rejected ([MS-SMB2] §3.3.5.22.1).
Constants§
- DHANDLE_
FLAG_ 🔒PERSISTENT - Durable-handle flag marking a persistent handle ([MS-SMB2] §2.2.14.2.12).
- STYPE_
IPC_ 🔒SPECIAL - Share type for a hidden IPC$ pipe share: STYPE_IPC | STYPE_SPECIAL ([MS-SRVS] §2.2.2.4).
Statics§
Functions§
- compatible 🔒
- A new
(access, share)open is compatible with anexistingopen when each side permits the other’s access through its share flags ([MS-FSA] §2.1.5.1). - next_
fid - Allocate a fresh FID.
- next_id 🔒
- next_
sid - Allocate a fresh search SID.
- next_
tid - Allocate a fresh TID.
- next_
uid - Allocate a fresh UID.
- now_ms
- Milliseconds since the Unix epoch, used for durable-handle deadlines.
- overlaps 🔒
- Whether
[off, off+len)overlaps the held lock’s range. - wants_
delete 🔒 - wants_
read 🔒 - wants_
write 🔒
Type Aliases§
- Lease
Break - One lease-break notification:
(key, old_state, new_state, epoch, outbound, crypto)for a holder that must be broken ([MS-SMB2] §3.3.4.7). - Lock
Owner - Identifies the open that owns a byte-range lock:
(session_id, file_id). - Shared
Server - Convenience alias: refcounted shared server config.