diff mbox

[15/16] Btrfs: clean up for wait_extent_bit()

Message ID 4E1E603F.7040603@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Li Zefan July 14, 2011, 3:19 a.m. UTC
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>

We can just use cond_resched_lock().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 fs/btrfs/extent_io.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 6c7394f..1959a63 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -658,11 +658,7 @@  again:
 		if (start > end)
 			break;
 
-		if (need_resched()) {
-			spin_unlock(&tree->lock);
-			cond_resched();
-			spin_lock(&tree->lock);
-		}
+		cond_resched_lock(&tree->lock);
 	}
 out:
 	spin_unlock(&tree->lock);