From: Li Zefan Date: Thu, 14 Jul 2011 03:18:03 +0000 (+0000) Subject: Btrfs: clean up search_extent_mapping() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e016a038e829c7d1271e1d57b8002860bbdf0db;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git Btrfs: clean up search_extent_mapping() rb_node returned by __tree_search() can be a valid pointer or NULL, but won't be some errno. Signed-off-by: Li Zefan Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 2d0410344ea3..911a9db801e0 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -379,23 +379,12 @@ struct extent_map *search_extent_mapping(struct extent_map_tree *tree, em = rb_entry(next, struct extent_map, rb_node); goto found; } - if (!rb_node) { - em = NULL; - goto out; - } - if (IS_ERR(rb_node)) { - em = ERR_CAST(rb_node); - goto out; - } - em = rb_entry(rb_node, struct extent_map, rb_node); - goto found; - - em = NULL; - goto out; + if (!rb_node) + return NULL; + em = rb_entry(rb_node, struct extent_map, rb_node); found: atomic_inc(&em->refs); -out: return em; }