All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] btrfs: remove useless used space increment during space reservation
Date: Thu,  8 Sep 2022 12:31:52 +0100	[thread overview]
Message-ID: <221b489c8d0f2204a77517f3fb440b635914457a.1662636489.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1662636489.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

At space-info.c:__reserve_bytes(), we increment the 'used' variable, but
then we don't use the variable anymore, making the increment pointless.
The increment became useless with commit 2e294c60497f29 ("btrfs: simplify
the logic in need_preemptive_flushing"), so just remove it.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/space-info.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 477e57ace48d..30a256c8c2ea 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -1666,7 +1666,6 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info,
 				      &space_info->priority_tickets);
 		}
 	} else if (!ret && space_info->flags & BTRFS_BLOCK_GROUP_METADATA) {
-		used += orig_bytes;
 		/*
 		 * We will do the space reservation dance during log replay,
 		 * which means we won't have fs_info->fs_root set, so don't do
-- 
2.35.1


  parent reply	other threads:[~2022-09-08 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 11:31 [PATCH 0/3] btrfs: fix a couple of hangs during unmount caused by races fdmanana
2022-09-08 11:31 ` [PATCH 1/3] btrfs: fix hang during unmount when stopping block group reclaim worker fdmanana
2022-09-08 11:31 ` [PATCH 2/3] btrfs: fix hang during unmount when stopping a space " fdmanana
2022-09-08 11:31 ` fdmanana [this message]
2022-09-08 13:14 ` [PATCH 0/3] btrfs: fix a couple of hangs during unmount caused by races Josef Bacik
2022-09-09 14:32 ` David Sterba
2022-09-13 11:52   ` 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=221b489c8d0f2204a77517f3fb440b635914457a.1662636489.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.