summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2012-09-13 03:32:32 -0600
committerChris Mason <chris.mason@fusionio.com>2012-10-04 09:39:54 -0400
commit0433f20d436fd040013e5a419a2e3d732d618a41 (patch)
tree9a1c93fd7f2a78f20f22789a614b1e6656ad6872 /fs/btrfs/disk-io.c
parent90abccf2c6e6e9c5a5d519eaed95292afa30aa11 (diff)
downloadlinux-0433f20d436fd040013e5a419a2e3d732d618a41.tar.gz
linux-0433f20d436fd040013e5a419a2e3d732d618a41.tar.bz2
linux-0433f20d436fd040013e5a419a2e3d732d618a41.zip
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.c14
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,
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;
}