Expand description
Source-agnostic FD-transport mechanics for the splitdirfdstream wire protocol.
This module contains the pure, Storage/Layer-independent helpers that govern
how a set of file descriptors is partitioned into transport frames and how
the sparse dirfd-slot layout is computed. Both the composefs-storage
layer-transfer producer and future producers (e.g. a composefs-repo producer)
can share these primitives without pulling in any higher-level dependencies.
§Public API
| Item | Role |
|---|---|
MAX_FDS_PER_FRAME | Enforced per-frame fd cap (240, safely below 253). |
seed_from_id | Derive a deterministic u64 seed from an opaque string id. |
open_devnull | Open /dev/null for use as a dummy fd. |
FdLimitError | Error from split_fds_into_frames when more=false overflows. |
LayerFdLayout | Complete assembled wire layout from build_layer_fd_layout. |
build_layer_fd_layout | Assemble the full sparse dirfd+keepalive+lifetime fd array. |
split_fds_into_frames | Partition fds into frames, enforcing more=false cap. |
[spawn_self_reaping_producer] | Spawn the 3-phase keepalive-lock producer task (requires tokio feature). |
The producer-side seed jitter (sparse-slot placement, frame count, extra
lifetime fds) is computed by crate-internal helpers (sparse_dir_slots,
compute_n_frames, n_extra_lifetime_fds); the consumer never recomputes
it, since every FileBackedData chunk carries an explicit dirfd_index.
Structs§
- FdLimit
Error - Error returned by
split_fds_into_frameswhenmore=falseand the fd count exceedsMAX_FDS_PER_FRAME. - Layer
FdLayout - Assembled FD layout ready to wire to the client in one or more transport frames.
Constants§
- MAX_
FDS_ PER_ FRAME - Our enforced per-frame fd cap.
Functions§
- build_
layer_ fd_ layout - Build the complete wire fd layout for a producer serving
n_realreal diff directories. - open_
devnull - Open
/dev/nullas an opaque dummy fd. - seed_
from_ id - Derive a deterministic
u64seed from an opaque string identifier. - split_
fds_ into_ frames - Partition a complete fd array into transport frames.