diff options
author | David S. Miller <davem@davemloft.net> | 2009-03-19 02:53:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-19 02:53:57 -0400 |
commit | 0702b30dd821ac8a4103ddbe545518713fdca9be (patch) | |
tree | 8ce0c9f5e58c5ccb99870505eecd139986caa05e /fs/btrfs/locking.c | |
parent | 192d7a4667c6d11d1a174ec4cad9a3c5d5f9043c (diff) | |
parent | a1e4ee22863d41a6fbb24310d7951836cb6dafe7 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r-- | fs/btrfs/locking.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 9ebe9385129b..47b0a88c12a2 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c | |||
@@ -25,21 +25,10 @@ | |||
25 | #include "extent_io.h" | 25 | #include "extent_io.h" |
26 | #include "locking.h" | 26 | #include "locking.h" |
27 | 27 | ||
28 | /* | ||
29 | * btrfs_header_level() isn't free, so don't call it when lockdep isn't | ||
30 | * on | ||
31 | */ | ||
32 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
33 | static inline void spin_nested(struct extent_buffer *eb) | ||
34 | { | ||
35 | spin_lock_nested(&eb->lock, BTRFS_MAX_LEVEL - btrfs_header_level(eb)); | ||
36 | } | ||
37 | #else | ||
38 | static inline void spin_nested(struct extent_buffer *eb) | 28 | static inline void spin_nested(struct extent_buffer *eb) |
39 | { | 29 | { |
40 | spin_lock(&eb->lock); | 30 | spin_lock(&eb->lock); |
41 | } | 31 | } |
42 | #endif | ||
43 | 32 | ||
44 | /* | 33 | /* |
45 | * Setting a lock to blocking will drop the spinlock and set the | 34 | * Setting a lock to blocking will drop the spinlock and set the |
@@ -231,8 +220,8 @@ int btrfs_tree_unlock(struct extent_buffer *eb) | |||
231 | return 0; | 220 | return 0; |
232 | } | 221 | } |
233 | 222 | ||
234 | int btrfs_tree_locked(struct extent_buffer *eb) | 223 | void btrfs_assert_tree_locked(struct extent_buffer *eb) |
235 | { | 224 | { |
236 | return test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags) || | 225 | if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) |
237 | spin_is_locked(&eb->lock); | 226 | assert_spin_locked(&eb->lock); |
238 | } | 227 | } |