diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2012-09-13 05:32:54 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2012-10-04 09:39:54 -0400 |
commit | b4f359ab065b9c6c132124557d23e90e2e8504be (patch) | |
tree | 2833e229bc13a2e16bffbc9e90aea4d328bfd557 /fs/btrfs/disk-io.c | |
parent | 0433f20d436fd040013e5a419a2e3d732d618a41 (diff) |
Btrfs: remove unnecessary code in btree_get_extent()
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>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 8db87bc53d27..8d633e3e3919 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -217,16 +217,10 @@ static struct extent_map *btree_get_extent(struct inode *inode, | |||
217 | write_lock(&em_tree->lock); | 217 | write_lock(&em_tree->lock); |
218 | ret = add_extent_mapping(em_tree, em); | 218 | ret = add_extent_mapping(em_tree, em); |
219 | if (ret == -EEXIST) { | 219 | if (ret == -EEXIST) { |
220 | u64 failed_start = em->start; | ||
221 | u64 failed_len = em->len; | ||
222 | |||
223 | free_extent_map(em); | 220 | free_extent_map(em); |
224 | em = lookup_extent_mapping(em_tree, start, len); | 221 | em = lookup_extent_mapping(em_tree, start, len); |
225 | if (!em) { | 222 | if (!em) |
226 | lookup_extent_mapping(em_tree, failed_start, | ||
227 | failed_len); | ||
228 | em = ERR_PTR(-EIO); | 223 | em = ERR_PTR(-EIO); |
229 | } | ||
230 | } else if (ret) { | 224 | } else if (ret) { |
231 | free_extent_map(em); | 225 | free_extent_map(em); |
232 | em = ERR_PTR(ret); | 226 | em = ERR_PTR(ret); |