]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: make btrfs's allocation smoothly with preallocation
authorLiu Bo <liubo2009@cn.fujitsu.com>
Mon, 23 Jul 2012 11:50:03 +0000 (05:50 -0600)
committerChris Mason <chris.mason@fusionio.com>
Mon, 23 Jul 2012 20:28:10 +0000 (16:28 -0400)
commitc48a135fc1e8b86c3c9d22cf8f70a037fce5126b
tree4695986bc2458a8a66b5ac217a5ed03941014937
parent4fda9e418d44fafdfbf7395bd990938ba6edb409
Btrfs: make btrfs's allocation smoothly with preallocation

For backref walking, we've introduce delayed ref's sequence.  However,
it changes our preallocation behavior.

The story is that when we preallocate an extent and then mark it written
piece by piece, the ideal case should be that we don't need to COW the
extent, which is why we use 'preallocate'.

But we may not make use of preallocation, since when we check for cross refs on
the extent, we may have two ref entries which have the same content except
the sequence value, and we recognize them as cross refs and do COW to allocate
another extent.

So we end up with several pieces of space instead of an whole extent.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/extent-tree.c