Skip to content

Commit

Permalink
btrfs: remove hole check in prealloc_file_extent_cluster
Browse files Browse the repository at this point in the history
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 1851309 ("btrfs: update
btrfs_space_info's bytes_may_use timely") which came after the commit
introducing clustered/contiguous extents 0257bb8 ("Btrfs: relocate
file extents in clusters").

Let's just remove it as it adds noise to the source.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Nikolay Borisov authored and David Sterba committed Jul 27, 2020
1 parent 906c448 commit c171edd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c171edd

Please sign in to comment.