diff mbox series

[11/24] btrfs: remove redundant counter check at btrfs_truncate_inode_items()

Message ID 0618e34a343facf5c7ee34d0021ed6476c655a55.1679326432.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: cleanups and small fixes mostly around block reserves | expand

Commit Message

Filipe Manana March 21, 2023, 11:13 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

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.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/inode-item.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Anand Jain March 21, 2023, 1:31 p.m. UTC | #1
LGTM


Reviewed-by: Anand Jain <anand.jain@oracle.com>
diff mbox series

Patch

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 @@  int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
 				/* 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];