diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.h | 6 | ||||
-rw-r--r-- | fs/btrfs/locking.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index f8fccdac3055..eeb5afa6e9b1 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -42,7 +42,11 @@ struct btrfs_ordered_sum; | |||
42 | 42 | ||
43 | #define BTRFS_MAGIC "_B5RfS_M" | 43 | #define BTRFS_MAGIC "_B5RfS_M" |
44 | 44 | ||
45 | #define BTRFS_MAX_LEVEL 8 | 45 | #ifdef CONFIG_LOCKDEP |
46 | # define BTRFS_MAX_LEVEL 7 | ||
47 | #else | ||
48 | # define BTRFS_MAX_LEVEL 8 | ||
49 | #endif | ||
46 | 50 | ||
47 | /* holds pointers to all of the tree roots */ | 51 | /* holds pointers to all of the tree roots */ |
48 | #define BTRFS_ROOT_TREE_OBJECTID 1ULL | 52 | #define BTRFS_ROOT_TREE_OBJECTID 1ULL |
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 01a9ac2be3f7..27a02376ab14 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c | |||
@@ -37,7 +37,7 @@ int btrfs_tree_lock(struct extent_buffer *eb) | |||
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | cpu_relax(); | 39 | cpu_relax(); |
40 | mutex_lock(&eb->mutex); | 40 | mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb)); |
41 | return 0; | 41 | return 0; |
42 | } | 42 | } |
43 | 43 | ||