Btrfs: remove unnecessary code in btree_get_extent()
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>
Thu, 13 Sep 2012 09:32:54 +0000 (03:32 -0600)
committerChris Mason <chris.mason@fusionio.com>
Thu, 4 Oct 2012 13:39:54 +0000 (09:39 -0400)
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>
fs/btrfs/disk-io.c

index 8db87bc53d2706dff39f60cb3b50847bc73be86c..8d633e3e391924a236692cdf3077cdb7cdf8f153 100644 (file)
@@ -217,16 +217,10 @@ static struct extent_map *btree_get_extent(struct inode *inode,
        write_lock(&em_tree->lock);
        ret = add_extent_mapping(em_tree, em);
        if (ret == -EEXIST) {
-               u64 failed_start = em->start;
-               u64 failed_len = em->len;
-
                free_extent_map(em);
                em = lookup_extent_mapping(em_tree, start, len);
-               if (!em) {
-                       lookup_extent_mapping(em_tree, failed_start,
-                                             failed_len);
+               if (!em)
                        em = ERR_PTR(-EIO);
-               }
        } else if (ret) {
                free_extent_map(em);
                em = ERR_PTR(ret);