aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/locking.c
diff options
context:
space:
mode:
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 68fd9ccf1805..9ebe9385129b 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -236,25 +236,3 @@ int btrfs_tree_locked(struct extent_buffer *eb)
236 return test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags) || 236 return test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags) ||
237 spin_is_locked(&eb->lock); 237 spin_is_locked(&eb->lock);
238} 238}
239
240/*
241 * btrfs_search_slot uses this to decide if it should drop its locks
242 * before doing something expensive like allocating free blocks for cow.
243 */
244int btrfs_path_lock_waiting(struct btrfs_path *path, int level)
245{
246 int i;
247 struct extent_buffer *eb;
248
249 for (i = level; i <= level + 1 && i < BTRFS_MAX_LEVEL; i++) {
250 eb = path->nodes[i];
251 if (!eb)
252 break;
253 smp_mb();
254 if (spin_is_contended(&eb->lock) ||
255 waitqueue_active(&eb->lock_wq))
256 return 1;
257 }
258 return 0;
259}
260