diff options
author | Filipe Manana <fdmanana@suse.com> | 2023-03-21 14:13:47 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-04-17 19:01:19 +0300 |
commit | 4a6f5ccac52485226e7cade3dd7758f1a3ed8fa5 (patch) | |
tree | 1f4addaa0c2c5f87974050d701167ee4ad6fccb4 /fs/btrfs/inode-item.c | |
parent | 9aa06c7669dd45b9cd2f4df6f948108d4df1e34c (diff) | |
download | linux-4a6f5ccac52485226e7cade3dd7758f1a3ed8fa5.tar.xz |
btrfs: remove redundant counter check at btrfs_truncate_inode_items()
At btrfs_truncate_inode_items(), in the while loop when we decide that we
are going to delete an item, it's pointless to check that 'pending_del_nr'
is non-zero in an else clause because the corresponding if statement is
checking if 'pending_del_nr' has a value of zero. So just remove that
condition from the else clause.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.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.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index b65c45b5d681..b27c2c560083 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c @@ -660,8 +660,7 @@ delete: /* No pending yet, add ourselves */ pending_del_slot = path->slots[0]; pending_del_nr = 1; - } else if (pending_del_nr && - path->slots[0] + 1 == pending_del_slot) { + } else if (path->slots[0] + 1 == pending_del_slot) { /* Hop on the pending chunk */ pending_del_nr++; pending_del_slot = path->slots[0]; |