diff mbox series

[1/3] btrfs: Remove hole check in prealloc_file_extent_cluster

Message ID 20200617091044.27846-2-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series Refactor prealloc_file_extent_cluster | expand

Commit Message

Nikolay Borisov June 17, 2020, 9:10 a.m. UTC
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 18513091af948 which came
after the commit introducing clustered/contiguous extents: 0257bb82d21b.

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

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/relocation.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Johannes Thumshirn June 17, 2020, 12:57 p.m. UTC | #1
Looks ok,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
David Sterba June 17, 2020, 4:22 p.m. UTC | #2
On Wed, Jun 17, 2020 at 12:10:42PM +0300, Nikolay Borisov wrote:
> 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 18513091af948 which came
> after the commit introducing clustered/contiguous extents: 0257bb82d21b.

Please use full commit references like 18513091af94 ("btrfs: update
btrfs_space_info's bytes_may_use timely").
diff mbox series

Patch

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 11d156995446..348985c8a559 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);