mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
Btrfs: cleanup of error processing in btree_get_extent()
This patch simplifies a little complex error processing in btree_get_extent(). Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
This commit is contained in:
parent
90abccf2c6
commit
0433f20d43
1 changed files with 5 additions and 9 deletions
|
@ -222,21 +222,17 @@ static struct extent_map *btree_get_extent(struct inode *inode,
|
|||
|
||||
free_extent_map(em);
|
||||
em = lookup_extent_mapping(em_tree, start, len);
|
||||
if (em) {
|
||||
ret = 0;
|
||||
} else {
|
||||
em = lookup_extent_mapping(em_tree, failed_start,
|
||||
failed_len);
|
||||
ret = -EIO;
|
||||
if (!em) {
|
||||
lookup_extent_mapping(em_tree, failed_start,
|
||||
failed_len);
|
||||
em = ERR_PTR(-EIO);
|
||||
}
|
||||
} else if (ret) {
|
||||
free_extent_map(em);
|
||||
em = NULL;
|
||||
em = ERR_PTR(ret);
|
||||
}
|
||||
write_unlock(&em_tree->lock);
|
||||
|
||||
if (ret)
|
||||
em = ERR_PTR(ret);
|
||||
out:
|
||||
return em;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue