Btrfs: run chunk allocations while we do delayed refs
authorChris Mason <chris.mason@oracle.com>
Fri, 6 Jan 2012 20:23:57 +0000 (15:23 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 6 Jan 2012 20:23:57 +0000 (15:23 -0500)
commit203bf287cb01a5dc26c20bd3737cecf3aeba1d48
treef9ce9d7c82360bd6059b5ef16166cf79d16b1380
parentc1111b1fcee6359922ad8e5f6d72ed43815ad8f9
Btrfs: run chunk allocations while we do delayed refs

Btrfs tries to batch extent allocation tree changes to improve performance
and reduce metadata trashing.  But it doesn't allocate new metadata chunks
while it is doing allocations for the extent allocation tree.

This commit changes the delayed refence code to do chunk allocations if we're
getting low on room.  It prevents crashes and improves performance.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c