HAMMER 31A/many: File data size optimization
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 24 Feb 2008 19:48:45 +0000 (19:48 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 24 Feb 2008 19:48:45 +0000 (19:48 +0000)
commite38e0b155508103a79cec55a39c8d0556823eaf2
tree435712c0f77948b50d80d43d64c53ff7118dbca5
parentb46d96ffb1d8d8b16ecb7ae3427ad0935a7c2223
HAMMER 31A/many: File data size optimization

I've been meaning to do this for a while.  When writing a data record for
the last block in a file, for example for small files, there is no need
to write out the entire 16K buffer.  Just write out the actual number of
bytes of data to file EOF.

This results in *EXTREME* data compaction and very high performance when
manipulating small files.  The smallest possible file requires two 96 byte
records (inode record and data record), two 64 byte B-Tree elements,
a 64 byte data element (the file data), and a 128 byte data element
(the inode structure), for a grand total of 512 bytes.
sys/vfs/hammer/hammer_object.c
sys/vfs/hammer/hammer_vnops.c