-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Currently, a node in `TreeFS` is any one of: - A directory (`Map`) - A regular file (`FileMetaData` tuple) - A normalised symlink target (`string`) Symlink targets are normalised from their literal form ("literal" being the output of `readlink`) as they are added to the tree - this is done at runtime during Metro startup, or on updates - they are not persisted in the cache, as the tree is not persisted. In parallel, we maintain a flat `#files: Map<Path, FileMetaData>` structure that stores the other metadata of a symlink (modified time, etc.). This *is* persisted. This diff removes the special treatment of symlinks in the tree data structure, so that symlinks are also `FileMetaData` nodes. Note that `FileMetaData` itself contains the *literal* symlink target. There are two goals here: - Ensure all primary data is stored in the tree, so that we may serialise it *instead of* `#files`. - Don't store data in the tree whose derivation is platform-specific. Normalised paths use platform path-separators. To avoid the traversing the tree just to "warm up" symlink targets, we resolve symlinks the first time we hit them during a lookup or traversal, and cache the result in a `WeakMap`. Changelog: Internal Reviewed By: motiz88 Differential Revision: D46682954 fbshipit-source-id: 730bbd9f505fcaa0a7f2cf90e3fbfea836cc4917
- Loading branch information
1 parent
4c9b0d2
commit 183aba4
Showing
1 changed file
with
119 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters