]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do not needlessly restart the transaction for enospc
authorJosef Bacik <jbacik@fusionio.com>
Mon, 27 Aug 2012 21:48:15 +0000 (17:48 -0400)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:04 +0000 (15:19 -0400)
commit182c0bb72ad95ea9804c2920e0c731a61063cc32
tree9685496d94625bc732e029f2a21f049506bf8618
parentdeb0047158eca07cb98d67f55cab6d3b959e4ecd
Btrfs: do not needlessly restart the transaction for enospc

We will stop and restart a transaction every time we move to a different leaf
when truncating a file.  This is for enospc reasons, but really we could
probably get away with doing this a little better by actually working until we
hit an ENOSPC.  So add a ->failfast flag to the block_rsv and set it when we do
truncates which will fail as soon as the block rsv runs out of space, and then
at that point we can stop and restart the transaction and refill the block rsv
and carry on.  This will make rm'ing of a file with lots of extents a bit
faster.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c