From: Nikolay Borisov Date: Wed, 17 Jun 2020 09:10:42 +0000 (+0300) Subject: btrfs: remove hole check in prealloc_file_extent_cluster X-Git-Tag: v5.15~2817^2~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c171edd5c8e164bbcb46c61016ef4e88c8130edf;p=platform%2Fkernel%2Flinux-starfive.git btrfs: remove hole check in prealloc_file_extent_cluster Extents in the extent cluster are guaranteed to be contiguous as such the hole check inside the loop can never trigger. In fact this check was never functional since it was added in 18513091af94 ("btrfs: update btrfs_space_info's bytes_may_use timely") which came after the commit introducing clustered/contiguous extents 0257bb82d21b ("Btrfs: relocate file extents in clusters"). Let's just remove it as it adds noise to the source. Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba --- diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 9235c67..ade45fb 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2604,9 +2604,6 @@ int prealloc_file_extent_cluster(struct inode *inode, lock_extent(&BTRFS_I(inode)->io_tree, start, end); num_bytes = end + 1 - start; - if (cur_offset < start) - btrfs_free_reserved_data_space_noquota(inode, - start - cur_offset); ret = btrfs_prealloc_file_range(inode, 0, start, num_bytes, num_bytes, end + 1, &alloc_hint);