Btrfs: more efficient io tree navigation on wait_extent_bit

If we don't reschedule use rb_next to find the next extent state
instead of a full tree search, which is more efficient and safe
since we didn't release the io tree's lock.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Filipe Manana 2014-03-31 14:53:25 +01:00 committed by Chris Mason
parent c715e155c9
commit c50d3e71c3

View File

@ -749,6 +749,7 @@ again:
* our range starts
*/
node = tree_search(tree, start);
process_node:
if (!node)
break;
@ -769,7 +770,10 @@ again:
if (start > end)
break;
cond_resched_lock(&tree->lock);
if (!cond_resched_lock(&tree->lock)) {
node = rb_next(node);
goto process_node;
}
}
out:
spin_unlock(&tree->lock);