[PATCH] btrfs: remove redundant condition checks

From: Xichao Zhao
Date: Fri Sep 05 2025 - 04:03:35 EST


Remove redundant condition checks and replace else if with else.

Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
---
fs/btrfs/inode-item.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index f06cf701ae5a..3d0631bf7389 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -531,7 +531,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
if (extent_type != BTRFS_FILE_EXTENT_INLINE)
item_end +=
btrfs_file_extent_num_bytes(leaf, fi);
- else if (extent_type == BTRFS_FILE_EXTENT_INLINE)
+ else
item_end += btrfs_file_extent_ram_bytes(leaf, fi);

btrfs_trace_truncate(control->inode, leaf, fi,
@@ -586,7 +586,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
control->sub_bytes += num_dec;
}
clear_len = num_dec;
- } else if (extent_type == BTRFS_FILE_EXTENT_INLINE) {
+ } else {
/*
* We can't truncate inline items that have had
* special encodings
--
2.34.1