Skip to main content

Module index

Module index 

Source
Expand description

In-memory per-volume index: struct-of-arrays, two string pools with shared offsets, FRN map, and pre-sorted permutations for instant sorting (docs/ARCHITECTURE.md).

Mutation model (keeps the permutation arrays merge-only):

  • create → append entry + merge into permutations
  • delete → tombstone flag only
  • rename → files: tombstone old + append new entry (same FRN); dirs: in-place (children point at the EntryId), repositioned in perm_name
  • move → rewrite parent only (no permutation depends on the path)

Tombstones accumulate until compaction (M2), which bumps structural_generation and invalidates open result handles. Ordinary batches bump content_generation only; open results stay readable.

Modules§

builder 🔒
compact 🔒
Compaction (M2): rebuild the index without tombstoned rows and without the name bytes renames abandoned in the pools. Without it both grow forever under USN traffic and eventually eat the B/entry RAM budget.
core 🔒
flags
Per-entry flag bits packed into the index’s flags column (one u8).
frn 🔒
Record-number → EntryId lookup as a sorted permutation (ADR-0005): one id array maintained merge-only, exactly like the sort permutations. Appends collect in an unmerged tail that lookups scan linearly, and the end-of-batch merge folds them in sorted order. The keys are the frn column itself, read through the id indirection — a probe pays one extra cache miss, which only the USN path and the builder’s parent resolution ever do (never a search).
mutate 🔒
snapshot 🔒

Structs§

EncodedEntry
A RawEntry whose name is already WTF-8 encoded.
FinishTimings
Stage timings of VolumeIndexBuilder::finish_timed, in milliseconds.
Frn
A full 64-bit NTFS file reference number: (sequence << 48) | record.
RawEntry
One record produced by an initial-scan source (raw $MFT today, ReFS enumeration in the future).
RecordNo
An MFT record number — an Frn’s low 48 bits.
VolumeIndex
In-memory per-volume index.
VolumeIndexBuilder
Two-pass builder for the initial scan: collect everything, then resolve parents and sort the permutations (scan order ≠ parent-before-child).

Enums§

SortKey
Which result column results are ordered by (FmfQueryOptions.sort_key).

Constants§

NO_PARENT
Sentinel parent value for an entry attached to the volume root (no parent).

Functions§

merge_sorted_tail 🔒
Merge sorted batch into perm in place: each batch element binary-searches its insertion point and the segments between insertion points move once with copy_within — O(batch·log n) comparisons + O(moved) memmove + no allocation (ADR-0008).
reserve_bounded 🔒
reserve_exact with a len/64 floor, for merge-only arrays that grow a small batch at a time: bounds both copy frequency and permanent slack to ~1.6% (doubling would pin up to 2× as slack against the B/entry RAM gate).

Type Aliases§

EntryId
Dense, append-only index into the struct-of-arrays entry columns.