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 inperm_name - move → rewrite
parentonly (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
flagscolumn (oneu8). - frn 🔒
- Record-number →
EntryIdlookup 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 thefrncolumn 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§
- Encoded
Entry - A
RawEntrywhose name is already WTF-8 encoded. - Finish
Timings - 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,
ReFSenumeration in the future). - Record
No - An MFT record number — an
Frn’s low 48 bits. - Volume
Index - In-memory per-volume index.
- Volume
Index Builder - 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
parentvalue for an entry attached to the volume root (no parent).
Functions§
- merge_
sorted_ 🔒tail - Merge sorted
batchintopermin place: each batch element binary-searches its insertion point and the segments between insertion points move once withcopy_within— O(batch·log n) comparisons + O(moved) memmove + no allocation (ADR-0008). - reserve_
bounded 🔒 reserve_exactwith alen/64floor, 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.