From 56c31f13d688cd1337695681a419f1afa4c8ec40 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Wed, 19 Jun 2019 17:04:37 +0300 Subject: [PATCH] btrfs-progs: Remove redundant if '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 Signed-off-by: David Sterba --- extent-tree.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/extent-tree.c b/extent-tree.c index 7c107e15..93c99c38 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -2075,7 +2075,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 != @@ -2089,13 +2088,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);