]> 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)
commita24e80836f7f0e5c55a4a691336ab1a789c42922
tree9685496d94625bc732e029f2a21f049506bf8618
parent9fa82623572ad56cdbc0939a53a0a6e9c9f394d2
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