Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e016a03 authored by Li Zefan's avatar Li Zefan Committed by Chris Mason
Browse files

Btrfs: clean up search_extent_mapping()



rb_node returned by __tree_search() can be a valid pointer or NULL,
but won't be some errno.

Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 85d85a74
Loading
Loading
Loading
Loading
+3 −14
Original line number Original line Diff line number Diff line
@@ -379,23 +379,12 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
		em = rb_entry(next, struct extent_map, rb_node);
		em = rb_entry(next, struct extent_map, rb_node);
		goto found;
		goto found;
	}
	}
	if (!rb_node) {
	if (!rb_node)
		em = NULL;
		return NULL;
		goto out;
	}
	if (IS_ERR(rb_node)) {
		em = ERR_CAST(rb_node);
		goto out;
	}
	em = rb_entry(rb_node, struct extent_map, rb_node);
	goto found;

	em = NULL;
	goto out;


	em = rb_entry(rb_node, struct extent_map, rb_node);
found:
found:
	atomic_inc(&em->refs);
	atomic_inc(&em->refs);
out:
	return em;
	return em;
}
}