public inbox for linux-btrfs@vger.kernel.org
 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/4] btrfs-progs: Remove redundant if
Date: Wed, 19 Jun 2019 17:04:37 +0300	[thread overview]
Message-ID: <20190619140440.5550-2-nborisov@suse.com> (raw)
In-Reply-To: <20190619140440.5550-1-nborisov@suse.com>

'pin' is always true in __free_extent so there is no point in checking
it. Just remove the if and unindent the code.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 extent-tree.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/extent-tree.c b/extent-tree.c
index c6516b2ba445..7693313c50b3 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2074,7 +2074,6 @@ static int __free_extent(struct btrfs_trans_handle *trans,
 		}
 	} else {
 		int mark_free = 0;
-		int pin = 1;
 
 		if (found_extent) {
 			BUG_ON(is_data && refs_to_drop !=
@@ -2088,13 +2087,11 @@ static int __free_extent(struct btrfs_trans_handle *trans,
 			}
 		}
 
-		if (pin) {
-			ret = pin_down_bytes(trans, bytenr, num_bytes,
-					     is_data);
-			if (ret > 0)
-				mark_free = 1;
-			BUG_ON(ret < 0);
-		}
+		ret = pin_down_bytes(trans, bytenr, num_bytes,
+				     is_data);
+		if (ret > 0)
+			mark_free = 1;
+		BUG_ON(ret < 0);
 
 		ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
 				      num_to_del);
-- 
2.17.1


  reply	other threads:[~2019-06-19 14:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 14:04 [PATCH 0/4] Spring cleaning Nikolay Borisov
2019-06-19 14:04 ` Nikolay Borisov [this message]
2019-06-19 14:04 ` [PATCH 2/4] btrfs-progs: Remove commented code Nikolay Borisov
2019-06-19 22:28   ` David Sterba
2019-06-19 14:04 ` [PATCH 3/4] btrfs: Remove old send implementation Nikolay Borisov
2019-06-19 22:30   ` David Sterba
2019-06-19 14:04 ` [PATCH 4/4] btrfs-progs: check: Remove duplicated and commented functions Nikolay Borisov
2019-06-19 22:35 ` [PATCH 0/4] Spring cleaning 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=20190619140440.5550-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