]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: update may_commit_transaction to use the delayed refs rsv
authorJosef Bacik <josef@toxicpanda.com>
Mon, 3 Dec 2018 15:20:34 +0000 (10:20 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:47 +0000 (14:51 +0100)
commit9cf379b76fd349c4081a5fa3dca10f9a4e09dc04
tree456ab9cccbb1dd3c76ebf4f3b00d62c27d1bf08e
parente68f199ed54e031aa8797efd11b114658fca2c4e
btrfs: update may_commit_transaction to use the delayed refs rsv

Any space used in the delayed_refs_rsv will be freed up by a transaction
commit, so instead of just counting the pinned space we also need to
account for any space in the delayed_refs_rsv when deciding if it will
make a different to commit the transaction to satisfy our space
reservation.  If we have enough bytes to satisfy our reservation ticket
then we are good to go, otherwise subtract out what space we would gain
back by committing the transaction and compare that against the pinned
space to make our decision.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c