Skip to main content

Module hfsplus_clone

Module hfsplus_clone 

Source
Expand description

Source-side snapshot types for the HFS+ reformat-and-copy pipeline.

Step 10 of docs/hfsplus_enhancements.md. Parallel to hfs_clone.rs, but for HFS+/HFSX. Nothing here mutates the source volume; these structs capture every byte of metadata that must survive a clone-shrink so later steps can replay it onto a freshly-formatted target.

Step 14 wired extended-attribute capture into both SourceFileSnapshot and SourceDirSnapshot. Step 17 added file-hardlink support: stubs routed into a separate SourceHardlinkSnapshot list and inodes (files under \0\0\0\0HFS+ Private Data named iNode<N>) flagged with is_inode = true. Step 18 (this revision) does the same for directory hardlinks: file rows with FInfo fdrp/MACS route into SourceDirHardlinkSnapshot, and folders under .HFS+ Private Directory Data\r named dir_<N> are flagged with is_dir_inode = true. Replay (Step 21) emits each directory inode once and points each link at it.

Structs§

HfsPlusCloneReport
Outcome of clone_hfsplus_volume. Counts mirror the source side; any non-fatal per-entry skips end up in skipped rather than the result.
SourceCatalogSnapshot
Full capture of a source HFS+/HFSX volume: volume metadata plus every directory and file record. Catalog thread records are not captured — the target writer recreates them from scratch.
SourceDirHardlinkSnapshot
One directory-hardlink stub captured from the source catalog. The stub is encoded as a FILE record on disk; replay re-emits it the same way (FInfo fdrp/MACS plus bsdInfo.special = inode_num).
SourceDirSnapshot
Per-directory metadata captured from a kHFSPlusFolderRecord.
SourceFileSnapshot
Per-file metadata captured from a kHFSPlusFileRecord.
SourceHardlinkSnapshot
One file-hardlink stub captured from the source catalog. Replay creates inode_count inodes once and N stub rows pointing at them.
SourceVolumeSnapshot
Volume-level metadata captured from the source.

Functions§

clone_hfsplus_volume
BFS-replay every directory, file, hardlink, and xattr from source onto target. Step 21 of docs/hfsplus_enhancements.md.