diff options
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r-- | fs/btrfs/locking.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 6d8db2f5c38d..a5310c0f41e2 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c | |||
@@ -96,11 +96,12 @@ int btrfs_try_spin_lock(struct extent_buffer *eb) | |||
96 | { | 96 | { |
97 | int i; | 97 | int i; |
98 | 98 | ||
99 | spin_nested(eb); | 99 | if (btrfs_spin_on_block(eb)) { |
100 | if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) | 100 | spin_nested(eb); |
101 | return 1; | 101 | if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) |
102 | spin_unlock(&eb->lock); | 102 | return 1; |
103 | 103 | spin_unlock(&eb->lock); | |
104 | } | ||
104 | /* spin for a bit on the BLOCKING flag */ | 105 | /* spin for a bit on the BLOCKING flag */ |
105 | for (i = 0; i < 2; i++) { | 106 | for (i = 0; i < 2; i++) { |
106 | cpu_relax(); | 107 | cpu_relax(); |