Skip to main content

Module worktree_convert_remove

Module worktree_convert_remove 

Source
Expand description

The removal of the old tree of a conversion beneath a pinned descriptor. What: Remove the old tree of a conversion, but only the directory the journal recorded, pinned by a descriptor from the moment its identity is checked until its last entry is gone. Why: A device and inode read from a path say nothing about what the path names a moment later: another process can rename the recorded directory away and put an unrelated one at the name before a recursive delete resolves it again. The directory is opened below its parent without following a link, its identity is read from that descriptor, its entries are removed through the descriptor’s own path, and the last step removes the name only while it still names the same object and only if that object is empty (a directory removal cannot take a tree).

In TS you’d write (pseudocode):

const outcome = await removeRecordedOldTree({ platform, parent, name, oldRoot, installed }); // 'removed' | 'absent' | { kept: reason } | { differs: reason }

Enums§

Removal
What a request to remove the old tree did.

Functions§

remove_recorded_old_tree
What: Remove the directory name of parent if it is the old root, deleting beneath a descriptor on it. Why: See the module description.
remove_recorded_old_tree_seamed
remove_recorded_old_tree with a call right after the directory was pinned and judged to be the old tree, where a control moves it away and puts another directory at the name.