summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/ctree.h6
-rw-r--r--fs/btrfs/locking.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index f8fccdac305..eeb5afa6e9b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -42,7 +42,11 @@ struct btrfs_ordered_sum;
#define BTRFS_MAGIC "_B5RfS_M"
-#define BTRFS_MAX_LEVEL 8
+#ifdef CONFIG_LOCKDEP
+# define BTRFS_MAX_LEVEL 7
+#else
+# define BTRFS_MAX_LEVEL 8
+#endif
/* holds pointers to all of the tree roots */
#define BTRFS_ROOT_TREE_OBJECTID 1ULL
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 01a9ac2be3f..27a02376ab1 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -37,7 +37,7 @@ int btrfs_tree_lock(struct extent_buffer *eb)
return 0;
}
cpu_relax();
- mutex_lock(&eb->mutex);
+ mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb));
return 0;
}