[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250905080103.382846-1-zhao.xichao@vivo.com>
Date: Fri, 5 Sep 2025 16:01:03 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: clm@...com,
josef@...icpanda.com,
dsterba@...e.com
Cc: linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH] btrfs: remove redundant condition checks
Remove redundant condition checks and replace else if with else.
Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
---
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
Powered by blists - more mailing lists