Skip to main content

produce_layer_splitdirfdstream

Function produce_layer_splitdirfdstream 

Source
pub fn produce_layer_splitdirfdstream<ObjectID: FsVerityHashValue, W: Write>(
    repo: &Repository<ObjectID>,
    layer_verity: &ObjectID,
    objects_dirfd_index: u32,
    out: W,
) -> Result<()>
Expand description

Produce a splitdirfdstream for the layer splitstream identified by layer_verity, writing it to out.

External objects are emitted as references of the form "xx/yyyy" beneath the repository’s objects/ directory. The consumer must supply the objects directory at dirfd_index within the sparse dirfds region (obtained from composefs_splitdirfdstream::build_layer_fd_layout’s real_indices[0]).

This is the read/serve side that mirrors drain_splitdirfdstream: given the same repo, a stream produced here and then passed through composefs_splitdirfdstream::reconstruct with the repo’s objects dir will yield byte-identical output to calling composefs::splitstream::SplitStreamReader::cat on the same layer.

§Arguments

  • repo — Repository that holds the layer and its objects.
  • layer_verity — fs-verity hash of the layer splitstream to serve.
  • objects_dirfd_index — Slot index within the sparse dirfds region where the repository objects directory fd is placed (from real_indices[0]).
  • out — Destination writer for the produced splitdirfdstream.