summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode-item.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2021-12-04 01:18:18 +0300
committerDavid Sterba <dsterba@suse.com>2022-01-07 16:18:25 +0300
commit0adbc6190c34b2e39f67b086cefc260e30045f48 (patch)
tree45986e82d1ad8ccc37254331b03ac15398ef91cf /fs/btrfs/inode-item.c
parent376b91d5702f8db14beb55148039684f808e0693 (diff)
downloadlinux-0adbc6190c34b2e39f67b086cefc260e30045f48.tar.xz
btrfs: combine extra if statements in btrfs_truncate_inode_items
We have if (del_item) // do something else // something else if (del_item) // do yet another thing else // something else entirely back to back in btrfs_truncate_inode_items, collapse these two sets of if statements into one. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r--fs/btrfs/inode-item.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index f7b02abb681b..ef1a9efe08c0 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -646,14 +646,11 @@ delete:
}
}
- if (del_item)
- control->last_size = found_key.offset;
- else
- control->last_size = new_size;
if (del_item) {
ASSERT(!pending_del_nr ||
((path->slots[0] + 1) == pending_del_slot));
+ control->last_size = found_key.offset;
if (!pending_del_nr) {
/* No pending yet, add ourselves */
pending_del_slot = path->slots[0];
@@ -665,6 +662,7 @@ delete:
pending_del_slot = path->slots[0];
}
} else {
+ control->last_size = new_size;
break;
}
should_throttle = false;