Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297864
b: refs/heads/master
c: 6763af8
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Mahoney authored and David Sterba committed Mar 22, 2012
1 parent 1119766 commit e50bcdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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: 538042801a479ebd316582ad10a9c3156b5b7548
refs/heads/master: 6763af84a69f23c1c79f00720982e74fcff4d1f3
12 changes: 5 additions & 7 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ void extent_io_tree_panic(struct extent_io_tree *tree, int err)
*
* the range [start, end] is inclusive.
*
* This takes the tree lock, and returns < 0 on error, > 0 if any of the
* bits were already set, or zero if none of the bits were already set.
* This takes the tree lock, and returns 0 on success and < 0 on error.
*/
int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
int bits, int wake, int delete,
Expand All @@ -477,7 +476,6 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
struct rb_node *node;
u64 last_end;
int err;
int set = 0;
int clear = 0;

if (delete)
Expand Down Expand Up @@ -562,7 +560,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (err)
goto out;
if (state->end <= end) {
set |= clear_state_bit(tree, state, &bits, wake);
clear_state_bit(tree, state, &bits, wake);
if (last_end == (u64)-1)
goto out;
start = last_end + 1;
Expand All @@ -585,13 +583,13 @@ 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);
clear_state_bit(tree, prealloc, &bits, wake);

prealloc = NULL;
goto out;
}

set |= clear_state_bit(tree, state, &bits, wake);
clear_state_bit(tree, state, &bits, wake);
next:
if (last_end == (u64)-1)
goto out;
Expand All @@ -608,7 +606,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (prealloc)
free_extent_state(prealloc);

return set;
return 0;

search_again:
if (start > end)
Expand Down

0 comments on commit e50bcdb

Please sign in to comment.