From: Chris Mason <chris.mason@oracle.com>
Date: Wed, 14 Jan 2009 18:40:46 +0000 (-0500)
Subject: Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cf47b8f3d96b0b8b10b557444a28b3ca4024ff82;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us

Mutexes now spin internally and the btrfs spin is no longer required for
performance.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---

diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 39bae7761db6..40ba8e8962f8 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -37,16 +37,6 @@
 
 int btrfs_tree_lock(struct extent_buffer *eb)
 {
-	int i;
-
-	if (mutex_trylock(&eb->mutex))
-		return 0;
-	for (i = 0; i < 512; i++) {
-		cpu_relax();
-		if (mutex_trylock(&eb->mutex))
-			return 0;
-	}
-	cpu_relax();
 	mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb));
 	return 0;
 }