From: Liu Bo Date: Tue, 11 Sep 2018 22:06:23 +0000 (+0800) Subject: Btrfs: remove unnecessary level check in balance_level X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=98e6b1eb4022f2eb9845f0da5f16c179e5f32b9f;p=openwrt%2Fstaging%2Fblogic.git 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 Reviewed-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- 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];