btrfs: remove redundant counter check at btrfs_truncate_inode_items()
authorFilipe Manana <fdmanana@suse.com>
Tue, 21 Mar 2023 11:13:47 +0000 (11:13 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:19 +0000 (18:01 +0200)
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>
fs/btrfs/inode-item.c

index b65c45b5d681091524879f24b1045bc9d0439c4e..b27c2c56008333592692c4fcfb55bc7d5ca18ff5 100644 (file)
@@ -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];