Added lfs_rbyd_rangesize (untested), some cleanup

Toying around with the idea that since rbyd trees have strict height
gaurantees after compaction (2*log2(n)+1), we can proactively calculate
the maximum on-disk space required for a worst case tree+leb128
encoding.

This would _greatly_ simplify things such as metadata compaction and
splitting, and allow unstorable file metadata (too many custom
attributes) to error early.

One issue is that this calculated worst case will likely be ~4-5x worst
than the actual encoding due to leb128 compression. Though this may be an
acceptable tradeoff for the simplification and more reliable behavior.
This commit is contained in:
Christopher Haster
2023-01-17 13:26:53 -06:00
parent 4aabb8f631
commit 8581eec433
3 changed files with 77 additions and 21 deletions

View File

@@ -53,7 +53,7 @@ def tagrepr(tag, size, off=None):
type = tag & 0x7fff
suptype = tag & 0x7807
subtype = (tag >> 3) & 0xff
id = (tag >> 15) & 0xffff
id = ((tag >> 15) & 0xffff) - 1
if suptype == 0x0800:
return 'mk%s id%d%s' % (