Whamcloud - gitweb
libext2fs: when appending to a file, don't split an index block in equal halves
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 1 May 2014 23:15:05 +0000 (16:15 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Aug 2014 23:18:39 +0000 (19:18 -0400)
commit07c479dd977d25986b32218f28987c1f6a370ab8
tree369762a53a73f96a427df263d5a8f22b9b23107c
parentbaa3544609da3c9bbe7e253b83f32df74e1015de
libext2fs: when appending to a file, don't split an index block in equal halves

When we're appending an extent to the end of a file and the index
block is full, don't split the index block into two half-full index
blocks because this leaves us with under utilized index blocks, at
least in the fallocate case.  Instead, copy the last extent from the
full block into the new block.  This isn't perfect utilization, but
there's a lot of work involved in teaching extent.c to be able to goto
a nonexistent node in a newly allocated (and empty) extent block.

This patch does not fix the general problem of keeping the extent tree
balanced.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/extent.c