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

Commit b4f359ab authored by Tsutomu Itoh's avatar Tsutomu Itoh Committed by Chris Mason
Browse files

Btrfs: remove unnecessary code in btree_get_extent()



Unnecessary lookup_extent_mapping() is removed because an error is
returned to the caller.
This patch was made based on the advice from Stefan Behrens, thanks.

Signed-off-by: default avatarTsutomu Itoh <t-itoh@jp.fujitsu.com>
parent 0433f20d
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -217,16 +217,10 @@ static struct extent_map *btree_get_extent(struct inode *inode,
	write_lock(&em_tree->lock);
	ret = add_extent_mapping(em_tree, em);
	if (ret == -EEXIST) {
		u64 failed_start = em->start;
		u64 failed_len = em->len;

		free_extent_map(em);
		em = lookup_extent_mapping(em_tree, start, len);
		if (!em) {
			lookup_extent_mapping(em_tree, failed_start,
					      failed_len);
		if (!em)
			em = ERR_PTR(-EIO);
		}
	} else if (ret) {
		free_extent_map(em);
		em = ERR_PTR(ret);