Skip to content

Commit

Permalink
Btrfs: remove unnecessary code in btree_get_extent()
Browse files Browse the repository at this point in the history
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: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
  • Loading branch information
Tsutomu Itoh authored and Chris Mason committed Oct 4, 2012
1 parent 0433f20 commit b4f359a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b4f359a

Please sign in to comment.