Btrfs: Fix allocation routines to avoid intermixing data and metadata allocations

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2007-10-15 16:17:44 -04:00
parent 6b80053d02
commit e19caa5f0e
2 changed files with 25 additions and 19 deletions

View File

@@ -981,7 +981,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
struct extent_state *state;
int ret = 1;
write_lock_irq(&tree->lock);
read_lock_irq(&tree->lock);
/*
* this search will find all the extents that end after
* our range starts.
@@ -993,7 +993,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
while(1) {
state = rb_entry(node, struct extent_state, rb_node);
if (state->state & bits) {
if (state->end >= start && (state->state & bits)) {
*start_ret = state->start;
*end_ret = state->end;
ret = 0;
@@ -1004,7 +1004,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
break;
}
out:
write_unlock_irq(&tree->lock);
read_unlock_irq(&tree->lock);
return ret;
}
EXPORT_SYMBOL(find_first_extent_bit);