/* btrfs_search_slot will keep the lock held on higher nodes in a few corner cases, such as COW of the block at slot zero in the node. This ignores those rules, and it should only be called when there are no more updates to be done higher up in the tree.  */
noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
/* btrfs_search_slot will keep the lock held on higher nodes in a few corner cases, such as COW of the block at slot zero in the node. This ignores those rules, and it should only be called when there are no more updates to be done higher up in the tree.  */
noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
{
	int i;
	if (path->keep_locks)
		return;
	for (i = level; i < BTRFS_MAX_LEVEL; i++) {
		if (!path->nodes[i])
			continue;
		if (!path->locks[i])
			continue;
		btrfs_tree_unlock(path->nodes[i]);
		path->locks[i] = 0;
	}
}