summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-01-08 17:20:54 +0300
committerDavid Sterba <dsterba@suse.cz>2015-03-03 19:23:56 +0300
commit351810c1d2aafa288af61844d877941d516fb031 (patch)
tree895beffc58abf520af6b1672d1245bb889e1ec11 /fs/btrfs/transaction.c
parent853d8ec4b288ce52b49e12beeef0f3659ac423ce (diff)
downloadlinux-351810c1d2aafa288af61844d877941d516fb031.tar.xz
btrfs: use cond_resched_lock where possible
Clean the opencoded variant, cond_resched_lock also checks the lock for contention so it might help in some cases that were not covered by simple need_resched(). Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 038fcf6051e0..efc5ebffa7ea 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -93,11 +93,8 @@ static void clear_btree_io_tree(struct extent_io_tree *tree)
*/
ASSERT(!waitqueue_active(&state->wq));
free_extent_state(state);
- if (need_resched()) {
- spin_unlock(&tree->lock);
- cond_resched();
- spin_lock(&tree->lock);
- }
+
+ cond_resched_lock(&tree->lock);
}
spin_unlock(&tree->lock);
}