-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved revision count noise behind ifdef LFS_NOISY
littlefs is intentionally designed to not rely on noise, even with cksum collisions (hello, perturb bit!). So it makes sense for this to be an optional feature, even if it's a small one. Disabling revision count noise by default also helps with testing. The whole point of revision count noise is to make cksum collisions less likely, which is a bit counterproductive when that's something we want to test! This doesn't really change the revision count encoding: vvvvrrrr rrrrrrnn nnnnnnnn nnnnnnnn '-.''----.----''---------.--------' '------|---------------|---------- 4-bit relocation revision '---------------|---------- recycle-bits recycle counter '---------- pseudorandom noise (optional) I considered moving the recycle-bits down when we're not adding noise, but the extra logic just isn't worth making the revision count a bit more human-readable. --- This saves a small bit of code in the default build, at the cost of some code for the runtime checks in the LFS_NOISY build. Though I'm hoping future config work will let users opt-out of these runtime checks: code stack ctx before: 38548 2624 640 default after: 38508 (-0.1%) 2624 (+0.0%) 640 (+0.0%) LFS_NOISY after: 38568 (+0.1%) 2624 (+0.0%) 640 (+0.0%) Honestly the thing I'm more worried about is using one of our precious mount flags for this... There's not that many bits left!
- Loading branch information
Showing
6 changed files
with
193 additions
and
138 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
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
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
Oops, something went wrong.