Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 1/3] btrfs: Remove hole  check in prealloc_file_extent_cluster
Date: Wed, 17 Jun 2020 12:10:42 +0300	[thread overview]
Message-ID: <20200617091044.27846-2-nborisov@suse.com> (raw)
In-Reply-To: <20200617091044.27846-1-nborisov@suse.com>

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(-)

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);
-- 
2.17.1


  reply	other threads:[~2020-06-17  9:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  9:10 [PATCH 0/3] Refactor prealloc_file_extent_cluster Nikolay Borisov
2020-06-17  9:10 ` Nikolay Borisov [this message]
2020-06-17 12:57   ` [PATCH 1/3] btrfs: Remove hole check in prealloc_file_extent_cluster Johannes Thumshirn
2020-06-17 16:22   ` David Sterba
2020-06-17  9:10 ` [PATCH 2/3] btrfs: Perform data management operations outside of inode lock Nikolay Borisov
2020-06-17 12:54   ` Johannes Thumshirn
2020-06-17  9:10 ` [PATCH 3/3] btrfs: Use for loop in prealloc_file_extent_cluster Nikolay Borisov
2020-06-17 13:02   ` Johannes Thumshirn
2020-06-17 13:18     ` Nikolay Borisov
2020-06-17 16:38 ` [PATCH 0/3] Refactor prealloc_file_extent_cluster David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200617091044.27846-2-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox