Skip to main content

walk_freelist

Function walk_freelist 

Source
pub fn walk_freelist<F: FileBackend>(
    pager: &mut Pager<F>,
    head_raw: u64,
    page_count: u64,
    reachable: &mut HashSet<PageId>,
    failures: &mut Vec<IntegrityFailure>,
) -> Result<u64>
Expand description

Walk the freelist chain starting at head, inserting every link page into reachable and recording any chain breakage into failures. Returns the number of freelist link pages walked.

Bounded by page_count (a freelist chain cannot have more entries than the file has pages).

ยงErrors

Returns Error::Io on cache-miss read failure. Content-level breakage is recorded into failures (the walk does NOT abort on a broken link; the walker records the failure and stops the freelist sweep so a subsequent walk does not loop).