]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
btrfs: don't force commit if we are data
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:30 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:53 +0000 (12:06 +0200)
commitbb86bd3db82ed6d28d4ab4ed33c7ee3b27290e49
treebdfbf5847310191fe0bd865700fd265b04326b4d
parent028270013586681b02db49be20e05b56e662dc55
btrfs: don't force commit if we are data

We used to unconditionally commit the transaction at least 2 times and
then on the 3rd try check against pinned space to make sure committing
the transaction was worth the effort.  This is overkill, we know nobody
is going to steal our reservation, and if we can't make our reservation
with the pinned amount simply bail out.

This also cleans up the passing of bytes_needed to
may_commit_transaction, as that was the thing we added into place in
order to accomplish this behavior.  We no longer need it so remove that
mess.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/space-info.c