Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/2] btrfs: Remove always true condition in btrfs_start_delalloc_roots
Date: Mon, 11 Jan 2021 12:58:12 +0200	[thread overview]
Message-ID: <20210111105812.423915-2-nborisov@suse.com> (raw)
In-Reply-To: <20210111105812.423915-1-nborisov@suse.com>

Following the rework in
"btrfs: shrink delalloc pages instead of full inodes" the nr variable
is no longer passed by reference to start_delalloc_inodes hence it
cannot change. Additionally we are always guaranteed for it to be
positive number hence it's redundant to have it as a condition in the
loop. Simply remove that usage.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 69e24341afc0..eb0a25e75126 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9495,7 +9495,7 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, long nr,
 	mutex_lock(&fs_info->delalloc_root_mutex);
 	spin_lock(&fs_info->delalloc_root_lock);
 	list_splice_init(&fs_info->delalloc_roots, &splice);
-	while (!list_empty(&splice) && nr) {
+	while (!list_empty(&splice)) {
 		/*
 		 * Reset nr_to_write here so we know that we're doing a full
 		 * flush.
-- 
2.25.1


  reply	other threads:[~2021-01-11 10:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 10:58 [PATCH 1/2] btrfs: Make btrfs_start_delalloc_root's nr argument a long Nikolay Borisov
2021-01-11 10:58 ` Nikolay Borisov [this message]
2021-01-11 15:48 ` Josef Bacik
2021-01-11 21:39 ` 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=20210111105812.423915-2-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.cz \
    --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