]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
btrfs: use the btrfs_space_info_free_bytes_may_use helper for delalloc
authorJosef Bacik <josef@toxicpanda.com>
Tue, 21 Jul 2020 14:22:20 +0000 (10:22 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:06:52 +0000 (12:06 +0200)
We are going to use the ticket infrastructure for data, so use the
btrfs_space_info_free_bytes_may_use() helper in
btrfs_free_reserved_data_space_noquota() so we get the
btrfs_try_granting_tickets call when we free our reservation.

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

index 0e354e9e57d003e6a7a37c6695f225400bca3e0c..0a41bdcc14d1db83ac311064247e0a30d45f209c 100644 (file)
@@ -277,9 +277,7 @@ void btrfs_free_reserved_data_space_noquota(struct btrfs_fs_info *fs_info,
        ASSERT(IS_ALIGNED(len, fs_info->sectorsize));
 
        data_sinfo = fs_info->data_sinfo;
-       spin_lock(&data_sinfo->lock);
-       btrfs_space_info_update_bytes_may_use(fs_info, data_sinfo, -len);
-       spin_unlock(&data_sinfo->lock);
+       btrfs_space_info_free_bytes_may_use(fs_info, data_sinfo, len);
 }
 
 /*