Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165881
b: refs/heads/master
c: 40431d6
h: refs/heads/master
i:
  165879: b2319e4
v: v3
  • Loading branch information
Chris Mason committed Sep 11, 2009
1 parent e13f92f commit aa7e6a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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: 9042846bc7ae69cc3288d85af6bad16208d93a95
refs/heads/master: 40431d6c1288793a682fc6f5e5b5c9d5cac34608
15 changes: 13 additions & 2 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,8 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
BUG_ON(err == -EEXIST);
goto out;
}

state = rb_entry(node, struct extent_state, rb_node);
hit_next:
last_start = state->start;
last_end = state->end;

Expand All @@ -706,6 +706,7 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
* Just lock what we found and keep going
*/
if (state->start == start && state->end <= end) {
struct rb_node *next_node;
set = state->state & bits;
if (set && exclusive) {
*failed_start = state->start;
Expand All @@ -716,7 +717,17 @@ static int set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
merge_state(tree, state);
if (last_end == (u64)-1)
goto out;

start = last_end + 1;
if (start < end && prealloc && !need_resched()) {
next_node = rb_next(node);
if (next_node) {
state = rb_entry(next_node, struct extent_state,
rb_node);
if (state->start == start)
goto hit_next;
}
}
goto search_again;
}

Expand Down Expand Up @@ -852,7 +863,7 @@ int set_extent_delalloc(struct extent_io_tree *tree, u64 start, u64 end,
gfp_t mask)
{
return set_extent_bit(tree, start, end,
EXTENT_DELALLOC | EXTENT_DIRTY,
EXTENT_DELALLOC | EXTENT_DIRTY | EXTENT_UPTODATE,
0, NULL, mask);
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ static noinline int dirty_and_release_pages(struct btrfs_trans_handle *trans,
btrfs_set_trans_block_group(trans, inode);
hint_byte = 0;

set_extent_uptodate(io_tree, start_pos, end_of_last_block, GFP_NOFS);

/* check for reserved extents on each page, we don't want
* to reset the delalloc bit on things that already have
* extents reserved.
Expand Down

0 comments on commit aa7e6a9

Please sign in to comment.