Commit 6763af84 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by David Sterba

btrfs: Remove set bits return from clear_extent_bit

There is only one caller of clear_extent_bit that checks the return value
and it only checks if it's negative. Since there are no users of the
returned bits functionality of clear_extent_bit, stop returning it
and avoid complicating error handling.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
parent 53804280
...@@ -462,8 +462,7 @@ void extent_io_tree_panic(struct extent_io_tree *tree, int err) ...@@ -462,8 +462,7 @@ void extent_io_tree_panic(struct extent_io_tree *tree, int err)
* *
* the range [start, end] is inclusive. * the range [start, end] is inclusive.
* *
* This takes the tree lock, and returns < 0 on error, > 0 if any of the * This takes the tree lock, and returns 0 on success and < 0 on error.
* bits were already set, or zero if none of the bits were already set.
*/ */
int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
int bits, int wake, int delete, int bits, int wake, int delete,
...@@ -477,7 +476,6 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -477,7 +476,6 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
struct rb_node *node; struct rb_node *node;
u64 last_end; u64 last_end;
int err; int err;
int set = 0;
int clear = 0; int clear = 0;
if (delete) if (delete)
...@@ -562,7 +560,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -562,7 +560,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (err) if (err)
goto out; goto out;
if (state->end <= end) { if (state->end <= end) {
set |= clear_state_bit(tree, state, &bits, wake); clear_state_bit(tree, state, &bits, wake);
if (last_end == (u64)-1) if (last_end == (u64)-1)
goto out; goto out;
start = last_end + 1; start = last_end + 1;
...@@ -585,13 +583,13 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -585,13 +583,13 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (wake) if (wake)
wake_up(&state->wq); wake_up(&state->wq);
set |= clear_state_bit(tree, prealloc, &bits, wake); clear_state_bit(tree, prealloc, &bits, wake);
prealloc = NULL; prealloc = NULL;
goto out; goto out;
} }
set |= clear_state_bit(tree, state, &bits, wake); clear_state_bit(tree, state, &bits, wake);
next: next:
if (last_end == (u64)-1) if (last_end == (u64)-1)
goto out; goto out;
...@@ -608,7 +606,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, ...@@ -608,7 +606,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
if (prealloc) if (prealloc)
free_extent_state(prealloc); free_extent_state(prealloc);
return set; return 0;
search_again: search_again:
if (start > end) if (start > end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment