aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Bo <[email protected]>2018-09-12 06:06:23 +0800
committerDavid Sterba <[email protected]>2018-10-15 17:23:30 +0200
commit98e6b1eb4022f2eb9845f0da5f16c179e5f32b9f (patch)
tree210985ffde3e4d0594db747a16e4ce174bc10240
parent3cf5068f3d068d788871b0da1a0348048e68b9d6 (diff)
Btrfs: remove unnecessary level check in balance_level
In the callchain: btrfs_search_slot() if (level != 0) setup_nodes_for_search() balance_level() It is just impossible to have level=0 in balance_level, we can drop the check. Signed-off-by: Liu Bo <[email protected]> Reviewed-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
-rw-r--r--fs/btrfs/ctree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 1124d236291d..6178fadf80a1 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1815,8 +1815,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
int orig_slot = path->slots[level];
u64 orig_ptr;
- if (level == 0)
- return 0;
+ ASSERT(level > 0);
mid = path->nodes[level];