summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/locking.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-02-09 16:22:03 -0500
committerChris Mason <chris.mason@oracle.com>2009-02-09 16:22:03 -0500
commit284b066af41579f62649048fdec5c5e7091703e6 (patch)
treee34185c911cb50b0ade04f804056ffbe2a6e04ae /fs/btrfs/locking.c
parent42f15d77df8a7e8a2feb15041d5d30710ee7f951 (diff)
downloadop-kernel-dev-284b066af41579f62649048fdec5c5e7091703e6.zip
op-kernel-dev-284b066af41579f62649048fdec5c5e7091703e6.tar.gz
Btrfs: don't use spin_is_contended
Btrfs was using spin_is_contended to see if it should drop locks before doing extent allocations during btrfs_search_slot. The idea was to avoid expensive searches in the tree unless the lock was actually contended. But, spin_is_contended is specific to the ticket spinlocks on x86, so this is causing compile errors everywhere else. In practice, the contention could easily appear some time after we started doing the extent allocation, and it makes more sense to always drop the lock instead. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r--fs/btrfs/locking.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 68fd9cc..9ebe938 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -236,25 +236,3 @@ int btrfs_tree_locked(struct extent_buffer *eb)
return test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags) ||
spin_is_locked(&eb->lock);
}
-
-/*
- * btrfs_search_slot uses this to decide if it should drop its locks
- * before doing something expensive like allocating free blocks for cow.
- */
-int btrfs_path_lock_waiting(struct btrfs_path *path, int level)
-{
- int i;
- struct extent_buffer *eb;
-
- for (i = level; i <= level + 1 && i < BTRFS_MAX_LEVEL; i++) {
- eb = path->nodes[i];
- if (!eb)
- break;
- smp_mb();
- if (spin_is_contended(&eb->lock) ||
- waitqueue_active(&eb->lock_wq))
- return 1;
- }
- return 0;
-}
-
OpenPOWER on IntegriCloud