提交 0433f20d 编写于 作者: T Tsutomu Itoh 提交者: Chris Mason

Btrfs: cleanup of error processing in btree_get_extent()

This patch simplifies a little complex error processing in
btree_get_extent().
Signed-off-by: NTsutomu Itoh <t-itoh@jp.fujitsu.com>
上级 90abccf2
...@@ -222,21 +222,17 @@ static struct extent_map *btree_get_extent(struct inode *inode, ...@@ -222,21 +222,17 @@ static struct extent_map *btree_get_extent(struct inode *inode,
free_extent_map(em); free_extent_map(em);
em = lookup_extent_mapping(em_tree, start, len); em = lookup_extent_mapping(em_tree, start, len);
if (em) { if (!em) {
ret = 0; lookup_extent_mapping(em_tree, failed_start,
} else { failed_len);
em = lookup_extent_mapping(em_tree, failed_start, em = ERR_PTR(-EIO);
failed_len);
ret = -EIO;
} }
} else if (ret) { } else if (ret) {
free_extent_map(em); free_extent_map(em);
em = NULL; em = ERR_PTR(ret);
} }
write_unlock(&em_tree->lock); write_unlock(&em_tree->lock);
if (ret)
em = ERR_PTR(ret);
out: out:
return em; return em;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册