gc: Made lfsr_fs_gc a bit smarter when flags change

Now we consider if it's still possible for the current traversal to make
progress. If it can, we continue with the relevant masked flags,
otherwise we restart. This should prevent us from traversing the
filesystem for no reason.

I also reverted the ckedmeta/ckeddata flags, these ended up just adding
code cost. We're not in the stack hot-path anyways...

Code changes:

           code          stack
  before: 36244           2680
  after:  36228 (-0.0%)   2680 (+0.0%)
This commit is contained in:
Christopher Haster
2024-07-17 16:24:48 -05:00
parent c58a48c02e
commit 631bfbc1e8
2 changed files with 48 additions and 42 deletions
-2
View File
@@ -140,8 +140,6 @@ enum lfs_fsinfo_flags {
// internally used flags
LFS_F_ORPHANS = 0x8000, // Filesystem may have untracked orphans
LFS_F_CKEDMETA = 0x2000, // Filesystem metadata checked during gc
LFS_F_CKEDDATA = 0x4000, // Filesystem data checked during gc
};
// File types