diff options
author | Christopher Haster <chaster@utexas.edu> | 2017-10-11 02:48:24 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2017-10-13 04:31:33 +0300 |
commit | f3578e3250d1027bbc9e3fe2fa535b8ed540c5d8 (patch) | |
tree | 217a691e3a98a3229bcc48c71516aa353aa019f3 /DESIGN.md | |
parent | 83d4c614a09ed943b7bf9455a13dfaf63cb9e0b0 (diff) |
Removed clamping to block size in ctz linked-list
Initially, I was concerned that the number of pointers in the ctz
linked-list could exceed the storage in a block. Long story short
this isn't really possible outside of extremely small block sizes.
Since clamping impacts the layout of files on disk, removing the
block size removed quite a bit of logic and corner cases. Replaced
with an assert on block size during initialization.
---
Long story long, the minimum block size needed to store all ctz
pointers in a filesystem can be found with this formula:
B = (w/8)*log2(2^w / (B - 2*(w/8)))
where:
B = block size in bytes
w = pointer width in bits
It's not a very pretty formula, but does give us some useful info
if we apply some math:
min block size:
32 bit ctz linked-list = 104 bytes
64 bit ctz linked-list = 448 bytes
For littlefs, 128 bytes is a perfectly reasonable minimum block size.
Diffstat (limited to 'DESIGN.md')
0 files changed, 0 insertions, 0 deletions