diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2012-09-13 05:32:32 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-04 09:39:54 -0400 |
commit | 0433f20d436fd040013e5a419a2e3d732d618a41 (patch) | |
tree | 9a1c93fd7f2a78f20f22789a614b1e6656ad6872 /fs/btrfs/disk-io.c | |
parent | 90abccf2c6e6e9c5a5d519eaed95292afa30aa11 (diff) |
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>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8054f7ccf46a..8db87bc53d27 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -222,21 +222,17 @@ static struct extent_map *btree_get_extent(struct inode *inode, | |||
222 | 222 | ||
223 | free_extent_map(em); | 223 | free_extent_map(em); |
224 | em = lookup_extent_mapping(em_tree, start, len); | 224 | em = lookup_extent_mapping(em_tree, start, len); |
225 | if (em) { | 225 | if (!em) { |
226 | ret = 0; | 226 | lookup_extent_mapping(em_tree, failed_start, |
227 | } else { | 227 | failed_len); |
228 | em = lookup_extent_mapping(em_tree, failed_start, | 228 | em = ERR_PTR(-EIO); |
229 | failed_len); | ||
230 | ret = -EIO; | ||
231 | } | 229 | } |
232 | } else if (ret) { | 230 | } else if (ret) { |
233 | free_extent_map(em); | 231 | free_extent_map(em); |
234 | em = NULL; | 232 | em = ERR_PTR(ret); |
235 | } | 233 | } |
236 | write_unlock(&em_tree->lock); | 234 | write_unlock(&em_tree->lock); |
237 | 235 | ||
238 | if (ret) | ||
239 | em = ERR_PTR(ret); | ||
240 | out: | 236 | out: |
241 | return em; | 237 | return em; |
242 | } | 238 | } |