diff options
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 71b1ac15535..8a502ee2f23 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -42,7 +42,6 @@ void extent_map_exit(void) | |||
42 | void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) | 42 | void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) |
43 | { | 43 | { |
44 | tree->map.rb_node = NULL; | 44 | tree->map.rb_node = NULL; |
45 | tree->last = NULL; | ||
46 | spin_lock_init(&tree->lock); | 45 | spin_lock_init(&tree->lock); |
47 | } | 46 | } |
48 | EXPORT_SYMBOL(extent_map_tree_init); | 47 | EXPORT_SYMBOL(extent_map_tree_init); |
@@ -239,7 +238,6 @@ int add_extent_mapping(struct extent_map_tree *tree, | |||
239 | merge->in_tree = 0; | 238 | merge->in_tree = 0; |
240 | free_extent_map(merge); | 239 | free_extent_map(merge); |
241 | } | 240 | } |
242 | tree->last = em; | ||
243 | out: | 241 | out: |
244 | return ret; | 242 | return ret; |
245 | } | 243 | } |
@@ -273,10 +271,6 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, | |||
273 | u64 end = range_end(start, len); | 271 | u64 end = range_end(start, len); |
274 | 272 | ||
275 | BUG_ON(spin_trylock(&tree->lock)); | 273 | BUG_ON(spin_trylock(&tree->lock)); |
276 | em = tree->last; | ||
277 | if (em && end > em->start && start < extent_map_end(em)) | ||
278 | goto found; | ||
279 | |||
280 | rb_node = __tree_search(&tree->map, start, &prev, &next); | 274 | rb_node = __tree_search(&tree->map, start, &prev, &next); |
281 | if (!rb_node && prev) { | 275 | if (!rb_node && prev) { |
282 | em = rb_entry(prev, struct extent_map, rb_node); | 276 | em = rb_entry(prev, struct extent_map, rb_node); |
@@ -305,7 +299,6 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, | |||
305 | 299 | ||
306 | found: | 300 | found: |
307 | atomic_inc(&em->refs); | 301 | atomic_inc(&em->refs); |
308 | tree->last = em; | ||
309 | out: | 302 | out: |
310 | return em; | 303 | return em; |
311 | } | 304 | } |
@@ -327,8 +320,6 @@ int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em) | |||
327 | BUG_ON(spin_trylock(&tree->lock)); | 320 | BUG_ON(spin_trylock(&tree->lock)); |
328 | rb_erase(&em->rb_node, &tree->map); | 321 | rb_erase(&em->rb_node, &tree->map); |
329 | em->in_tree = 0; | 322 | em->in_tree = 0; |
330 | if (tree->last == em) | ||
331 | tree->last = NULL; | ||
332 | return ret; | 323 | return ret; |
333 | } | 324 | } |
334 | EXPORT_SYMBOL(remove_extent_mapping); | 325 | EXPORT_SYMBOL(remove_extent_mapping); |