Zach Brown fe94eb7363 scoutfs: add unwritten extents
Now that we have extents we can address the fragmentation of concurrent
writes with large preallocated unwritten extents instead of trying to
allocate from disjoint free space with cursors.

First we add support for unwritten extents.  Truncate needs to make sure
it doesn't treat truncated unwritten blocks as online just because
they're not offline.  If we try to write into them we convert them to
written extents.  And fiemap needs to flag them as unwritten and be sure
to check for extents past i_size.

Then we allocate unwritten extents only if we're extending a contiguous
file.  We try to preallocate the size of the file and cap it to a meg.
This ends up with a power of two progression of preallocation sizes,
which nicely balances extent sizes and wasted allocation as file sizes
increase.

We need to be careful to truncate the preallocated regions if the entire
file is released.  We take that as an indication that the user doesn't
want the file consuming any more space.

This removes most of the use of the cursor code.  It will be completely
removed in a further patch.

Signed-off-by: Zach Brown <zab@versity.com>
2018-06-29 14:42:06 -07:00
2018-06-29 14:42:06 -07:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%