]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/btrfs/locking.c
Btrfs: make a lockdep class for the extent buffer locks
[linux-2.6-omap-h63xx.git] / fs / btrfs / locking.c
index 68fd9ccf1805e63adf0973612f9822b9585034f8..85506c4a3af7406c248b575149863ccdb8eb88f0 100644 (file)
 #include "extent_io.h"
 #include "locking.h"
 
-/*
- * btrfs_header_level() isn't free, so don't call it when lockdep isn't
- * on
- */
-#ifdef CONFIG_DEBUG_LOCK_ALLOC
-static inline void spin_nested(struct extent_buffer *eb)
-{
-       spin_lock_nested(&eb->lock, BTRFS_MAX_LEVEL - btrfs_header_level(eb));
-}
-#else
 static inline void spin_nested(struct extent_buffer *eb)
 {
        spin_lock(&eb->lock);
 }
-#endif
 
 /*
  * Setting a lock to blocking will drop the spinlock and set the
@@ -236,25 +225,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;
-}
-