btrfs: perform data management operations outside of inode lock
authorNikolay Borisov <nborisov@suse.com>
Wed, 17 Jun 2020 09:10:43 +0000 (12:10 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:27 +0000 (12:55 +0200)
commit214e61d07e1ab9e497c081d1bad78d05f7c33abf
tree60ce7dc7340c1bab1da90bcce4489a4d861d5101
parentc171edd5c8e164bbcb46c61016ef4e88c8130edf
btrfs: perform data management operations outside of inode lock

btrfs_alloc_data_chunk_ondemand and btrfs_free_reserved_data_space_noquota
don't really use the guts of the inodes being passed to them. This
implies it's not required to call them under extent lock. Move code
around in prealloc_file_extent_cluster to do the heavy, data alloc/free
operations outside of the lock. This also makes the 'out' label
unnecessary, so remove it.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c