Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165916
b: refs/heads/master
c: 42daec2
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 24, 2009
1 parent b06a4ea commit b6d9e31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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: 7ce618db9878689f87897b673fa3329070860fc7
refs/heads/master: 42daec299b8b6b9605976d0ee1266b343a31cbcc
16 changes: 8 additions & 8 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,11 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (cached_state) {
cached = *cached_state;
*cached_state = NULL;
if (cached->tree && cached->start == start) {
cached_state = NULL;
if (cached && cached->tree && cached->start == start) {
atomic_dec(&cached->refs);
state = cached;
last_end = state->end;
goto found;
goto hit_next;
}
free_extent_state(cached);
}
Expand Down Expand Up @@ -547,8 +547,6 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (last_end == (u64)-1)
goto out;
start = last_end + 1;
} else {
start = state->start;
}
goto search_again;
}
Expand All @@ -566,16 +564,18 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,

if (wake)
wake_up(&state->wq);

set |= clear_state_bit(tree, prealloc, bits,
wake, delete);
prealloc = NULL;
goto out;
}
found:

if (state->end < end && prealloc && !need_resched())
next_node = rb_next(&state->rb_node);
else
next_node = NULL;

set |= clear_state_bit(tree, state, bits, wake, delete);
if (last_end == (u64)-1)
goto out;
Expand Down Expand Up @@ -712,6 +712,7 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
int err = 0;
u64 last_start;
u64 last_end;

again:
if (!prealloc && (mask & __GFP_WAIT)) {
prealloc = alloc_extent_state(mask);
Expand Down Expand Up @@ -756,6 +757,7 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
err = -EEXIST;
goto out;
}

set_state_bits(tree, state, bits);
cache_state(state, cached_state);
merge_state(tree, state);
Expand Down Expand Up @@ -809,8 +811,6 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (last_end == (u64)-1)
goto out;
start = last_end + 1;
} else {
start = state->start;
}
goto search_again;
}
Expand Down

0 comments on commit b6d9e31

Please sign in to comment.