aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-10-15 16:17:44 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:56 -0400
commite19caa5f0e34b571ed0c2617554af5c43cb124d1 (patch)
tree763e227bbce9325411955bb5cea5c5f1772b0a2d /fs/btrfs/extent_map.c
parent6b80053d02be41886344b5007d04e345311ec0b5 (diff)
Btrfs: Fix allocation routines to avoid intermixing data and metadata allocations
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 7ef3397a266d..e241699024da 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -981,7 +981,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
981 struct extent_state *state; 981 struct extent_state *state;
982 int ret = 1; 982 int ret = 1;
983 983
984 write_lock_irq(&tree->lock); 984 read_lock_irq(&tree->lock);
985 /* 985 /*
986 * this search will find all the extents that end after 986 * this search will find all the extents that end after
987 * our range starts. 987 * our range starts.
@@ -993,7 +993,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
993 993
994 while(1) { 994 while(1) {
995 state = rb_entry(node, struct extent_state, rb_node); 995 state = rb_entry(node, struct extent_state, rb_node);
996 if (state->state & bits) { 996 if (state->end >= start && (state->state & bits)) {
997 *start_ret = state->start; 997 *start_ret = state->start;
998 *end_ret = state->end; 998 *end_ret = state->end;
999 ret = 0; 999 ret = 0;
@@ -1004,7 +1004,7 @@ int find_first_extent_bit(struct extent_map_tree *tree, u64 start,
1004 break; 1004 break;
1005 } 1005 }
1006out: 1006out:
1007 write_unlock_irq(&tree->lock); 1007 read_unlock_irq(&tree->lock);
1008 return ret; 1008 return ret;
1009} 1009}
1010EXPORT_SYMBOL(find_first_extent_bit); 1010EXPORT_SYMBOL(find_first_extent_bit);