aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2019-08-22 15:10:58 -0400
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:18 +0200
commit18fa2284aac3f1071f51a897dc5585178cae458f (patch)
tree939897f2b525b22db6189834a96613c978a64075 /fs/btrfs/extent-tree.c
parentbtrfs: stop partially refilling tickets when releasing space (diff)
downloadlinux-dev-18fa2284aac3f1071f51a897dc5585178cae458f.tar.xz
linux-dev-18fa2284aac3f1071f51a897dc5585178cae458f.zip
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>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7d7e91f329ce..49cb26fa7c63 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2866,8 +2866,8 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
spin_unlock(&global_rsv->lock);
/* Add to any tickets we may have */
if (len)
- btrfs_space_info_add_new_bytes(fs_info,
- space_info, len);
+ btrfs_try_granting_tickets(fs_info,
+ space_info);
}
spin_unlock(&space_info->lock);
}