-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs: clean up filesystem import state
Clean up two aspects of importing filesystems: First: instead of trying to avoid crossing mountpoints (by checking `.st_dev`) in order to use `.st_ino` values as a "unique key" for tracking hardlinks, just take the `(.st_dev, .st_ino)` pair. This resolves some issues with overlayfs where adjacent files can end up with different `.st_dev`. Second: we were abusing the first setting of `st_dev` as a flag field to determine if we were `stat()`-ing the root inode or not, which was always a bit evil. We did this to avoid collecting the mtime of the root directory for determining the newest file in the filesystem. Let's change our approach here: we can collect the mtime when adding items to their parent directories (which is never done for the root directory). Use a impl on `Inode` to make it easier to collect that information. These changes together turn .stat() into a pure operation (with respect to the state of the reader), so remove the `&mut self` reference. Fixes #41 Signed-off-by: Allison Karlitskaya <[email protected]>
- Loading branch information
1 parent
2e7b18d
commit 314fbec
Showing
2 changed files
with
31 additions
and
36 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
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