Skip to content

Instantly share code, notes, and snippets.

@geky
Last active October 16, 2017 20:18
Show Gist options
  • Save geky/ab86c15492dca9caed69ca4e82dfef99 to your computer and use it in GitHub Desktop.
Save geky/ab86c15492dca9caed69ca4e82dfef99 to your computer and use it in GitHub Desktop.

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:

blwblwblw

min block size: 32 bit ctz linked-list = 104 bytes 64 bit ctz linked-list = 448 bytes

this is roughy O(n^2logn) or something blahl blab lab lb lhas alksjdf ;alksdnf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment