diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-07-13 23:18:03 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:30:49 -0400 |
commit | 7e016a038e829c7d1271e1d57b8002860bbdf0db (patch) | |
tree | 3698e7d02602b791f783a2b8877651f538db3543 | |
parent | 85d85a743da894029723e002eb556ceeebc03658 (diff) |
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 <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/extent_map.c | 17 |
1 files changed, 3 insertions, 14 deletions
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, | |||
379 | em = rb_entry(next, struct extent_map, rb_node); | 379 | em = rb_entry(next, struct extent_map, rb_node); |
380 | goto found; | 380 | goto found; |
381 | } | 381 | } |
382 | if (!rb_node) { | 382 | if (!rb_node) |
383 | em = NULL; | 383 | return NULL; |
384 | goto out; | ||
385 | } | ||
386 | if (IS_ERR(rb_node)) { | ||
387 | em = ERR_CAST(rb_node); | ||
388 | goto out; | ||
389 | } | ||
390 | em = rb_entry(rb_node, struct extent_map, rb_node); | ||
391 | goto found; | ||
392 | |||
393 | em = NULL; | ||
394 | goto out; | ||
395 | 384 | ||
385 | em = rb_entry(rb_node, struct extent_map, rb_node); | ||
396 | found: | 386 | found: |
397 | atomic_inc(&em->refs); | 387 | atomic_inc(&em->refs); |
398 | out: | ||
399 | return em; | 388 | return em; |
400 | } | 389 | } |
401 | 390 | ||