Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128536
b: refs/heads/master
c: 856bf3e
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent a0cae0e commit 96dba68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 257d0ce36f215937602eb5c1b328b69afaf3bcd8
refs/heads/master: 856bf3e592f917e7d663cb7fa93e83fe795e8f4e
8 changes: 7 additions & 1 deletion trunk/fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ static int add_lru(struct extent_map_tree *tree, struct extent_buffer *eb)
rm = list_entry(tree->buffer_lru.prev,
struct extent_buffer, lru);
tree->lru_size--;
list_del(&rm->lru);
list_del_init(&rm->lru);
free_extent_buffer(rm);
}
} else
Expand Down Expand Up @@ -2187,6 +2187,9 @@ struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
return eb;

fail:
spin_lock(&tree->lru_lock);
list_del_init(&eb->lru);
spin_unlock(&tree->lru_lock);
if (!atomic_dec_and_test(&eb->refs))
return NULL;
for (index = 0; index < i; index++) {
Expand Down Expand Up @@ -2246,6 +2249,9 @@ struct extent_buffer *find_extent_buffer(struct extent_map_tree *tree,
spin_unlock(&tree->lru_lock);
return eb;
fail:
spin_lock(&tree->lru_lock);
list_del_init(&eb->lru);
spin_unlock(&tree->lru_lock);
if (!atomic_dec_and_test(&eb->refs))
return NULL;
for (index = 0; index < i; index++) {
Expand Down

0 comments on commit 96dba68

Please sign in to comment.