]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: refactor the ticket wakeup code
authorJosef Bacik <josef@toxicpanda.com>
Thu, 22 Aug 2019 19:10:58 +0000 (15:10 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:18 +0000 (14:59 +0200)
commit8d487d6e66168d3e018d6708e5c749002c912bbc
tree939897f2b525b22db6189834a96613c978a64075
parentd050f886bcbff7d112623903168e6fabbc6a1782
btrfs: refactor the ticket wakeup code

Now that btrfs_space_info_add_old_bytes simply checks if we can make the
reservation and updates bytes_may_use, there's no reason to have both
helpers in place.

Factor out the ticket wakeup logic into it's own helper, make
btrfs_space_info_add_old_bytes() update bytes_may_use and then call the
wakeup helper, and replace all calls to btrfs_space_info_add_new_bytes()
with the wakeup helper.

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
fs/btrfs/space-info.c
fs/btrfs/space-info.h