[1/4] btrfs-progs: Remove redundant if
diff mbox series

Message ID 20190619140440.5550-2-nborisov@suse.com
State New
Headers show
Series
  • Spring cleaning
Related show

Commit Message

Nikolay Borisov June 19, 2019, 2:04 p.m. UTC
'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(-)

Patch
diff mbox series

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