Skip to main content

Module state

Module state 

Source
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§

amask 🔒
Windows share-mode access bits ([MS-SMB2] §2.2.13).
share 🔒
Share flags ([MS-SMB2] §2.2.13).

Structs§

AppInstanceTable
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).
BreakCrypto
Crypto material needed to sign/seal an unsolicited oplock break for a holder, snapshotted at grant time (mirrors the async completion path).
ConnState
Per-connection state machine.
DurableEntry
A durable file handle preserved across a connection drop so the client can reclaim it ([MS-SMB2] §3.3.1.10). Stored as Send metadata; on reconnect the file is re-opened (single-node model), so no live fd is held here.
HeldLock 🔒
LeaseHolder
A granted caching lease and the means to break it ([MS-SMB2] §2.2.23.2).
LeaseTable
Server-wide lease table: the set of caching-lease holders per file path.
LockManager
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.
OpenMode 🔒
One recorded open on a file: its granted access and the sharing it permits.
OplockHolder
A granted exclusive oplock and the means to break it.
OplockTable
Server-wide oplock table: at most one exclusive oplock per file path.
SearchCtx
Directory search continuation state keyed by search SID.
ServerShared
Global (per-process) server configuration and user database.
Session
An authenticated SMB session (one UID).
SessionEntry
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).
SessionTable
Server-wide table of established sessions, keyed by session id.
Share
A published share backed by a VFS instance.
ShareModeTable
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§

AppInstanceMatch
Outcome of matching a CREATE’s AppInstanceId against existing opens.
LeaseAckError
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§

FID 🔒
SID 🔒
TID 🔒
UID 🔒

Functions§

compatible 🔒
A new (access, share) open is compatible with an existing open 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§

LeaseBreak
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).
LockOwner
Identifies the open that owns a byte-range lock: (session_id, file_id).
SharedServer
Convenience alias: refcounted shared server config.