Commit Graph

11 Commits

Author SHA1 Message Date
Ryan Underwood
f7fd7d966a Corrections for typos and grammar 2019-09-01 21:11:49 -07:00
Christopher Haster
bdff4bc59e Updated DESIGN.md to reflect v2 changes
Now with graphs! Images are stored on the branch gh-images in an effort
to avoid binary bloat in the git history.

Also spruced up SPEC.md and README.md and ran a spellechecker over the
documentation. Favorite typo so far was dependendent, which is, in fact,
not a word.
2019-03-31 22:15:32 -05:00
Bernhard Reutner-Fischer
436707c8d0 doc: Editorial tweaks 2018-02-01 14:56:43 -06:00
Bernhard Reutner-Fischer
3457252fe6 doc: Spelling fixes 2018-01-31 19:18:51 -06:00
Christopher Haster
996cd8af22 Revisited documentation
Mostly changed the wording around the goals/features of littlefs based
on feedback from other developers.

Also added in project links now that there are a few of those floating
around. And made the README a bit easier to navigate.
2017-11-20 00:08:02 -06:00
Christopher Haster
0825d34f3d Adopted alternative implementation for lfs_ctz_index
Same runtime cost, however reduces the logic and avoids one of
the two big branches. See the DESIGN.md for more info.

Now uses these equations instead of the messy guess and correct method:
n = (N - w/8(popcount(N/(B-2w/8)) + 2)) / (B-2w/8)
off = N - (B-w2/8)n - w/8popcount(n)
2017-10-30 12:03:33 -05:00
Christopher Haster
46e22b2a38 Adopted lfs_ctz_index implementation using popcount
This reduces the O(n^2logn) runtime to read a file to only O(nlog).
The extra O(n) did not touch the disk, so it isn't a problem until the
files become very large, but this solution comes with very little cost.

Long story short, you can find the block index + offset pair for a
CTZ linked-list with this series of formulas:

n' = floor(N / (B - 2w/8))
N' = (B - 2w/8)n' + (w/8)popcount(n')
off' = N - N'
n, off =
  n'-1, off'+B                if off' <  0
  n',   off'+(w/8)(ctz(n')+1) if off' >= 0

For the long story, you will need to see the updated DESIGN.md
2017-10-18 00:44:30 -05:00
Christopher Haster
454b588f73 Updated SPEC.md and DESIGN.md based on recent changes
- Added math behind CTZ limits
- Added documentation over atomic moves
2017-10-12 20:31:33 -05:00
Christopher Haster
476915fee6 Removed a few "what"s from the documentation 2017-07-16 12:41:47 -05:00
Christopher Haster
0d66f9f991 Cleaned up design documentation 2017-06-28 15:50:29 -05:00
Christopher Haster
d2bf2bbc72 Added documentation over the underlying design 2017-05-18 23:44:18 -05:00