From: Tsutomu Itoh Date: Thu, 13 Sep 2012 09:32:54 +0000 (-0600) Subject: Btrfs: remove unnecessary code in btree_get_extent() X-Git-Tag: next-20121002~89^2~39 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=059380569f77218c68ef3d16487c99fa7971b822;p=karo-tx-linux.git 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 --- 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, 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);