]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: be smarter about committing the transaction in reserve_metadata_bytes
authorJosef Bacik <josef@redhat.com>
Fri, 4 Nov 2011 02:54:25 +0000 (22:54 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Nov 2011 02:20:51 +0000 (21:20 -0500)
commitd43eb6c0f83625f4c26ea287222836fc646e9704
treebd446d28acf52b836c811e3e31620e21eb336ead
parent7fcbfd88e7164957e42f04ded48efc1d7ad48f6a
Btrfs: be smarter about committing the transaction in reserve_metadata_bytes

Because of the overcommit stuff I had to make it so that we committed the
transaction all the time in reserve_metadata_bytes in case we had overcommitted
because of delayed items.  This was because previously we had no way of knowing
how much space was reserved for delayed items.  Now that we have the
delayed_block_rsv we can check it to see if committing the transaction would get
us anywhere.  This patch breaks out the committing logic into a helper function
that will check to see if committing the transaction would free enough space for
us to get anything done.  With this patch xfstests 83 goes from taking 445
seconds to taking 28 seconds on my box.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 663350ac38c67ca388acea6e876dc6d668c232b0)
fs/btrfs/extent-tree.c