diff options
Diffstat (limited to 'fs/btrfs/extent_map.c')
-rw-r--r-- | fs/btrfs/extent_map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 8a502ee2f231..954b047639ab 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c | |||
@@ -208,7 +208,7 @@ int add_extent_mapping(struct extent_map_tree *tree, | |||
208 | struct extent_map *merge = NULL; | 208 | struct extent_map *merge = NULL; |
209 | struct rb_node *rb; | 209 | struct rb_node *rb; |
210 | 210 | ||
211 | BUG_ON(spin_trylock(&tree->lock)); | 211 | assert_spin_locked(&tree->lock); |
212 | rb = tree_insert(&tree->map, em->start, &em->rb_node); | 212 | rb = tree_insert(&tree->map, em->start, &em->rb_node); |
213 | if (rb) { | 213 | if (rb) { |
214 | ret = -EEXIST; | 214 | ret = -EEXIST; |
@@ -270,7 +270,7 @@ struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, | |||
270 | struct rb_node *next = NULL; | 270 | struct rb_node *next = NULL; |
271 | u64 end = range_end(start, len); | 271 | u64 end = range_end(start, len); |
272 | 272 | ||
273 | BUG_ON(spin_trylock(&tree->lock)); | 273 | assert_spin_locked(&tree->lock); |
274 | rb_node = __tree_search(&tree->map, start, &prev, &next); | 274 | rb_node = __tree_search(&tree->map, start, &prev, &next); |
275 | if (!rb_node && prev) { | 275 | if (!rb_node && prev) { |
276 | em = rb_entry(prev, struct extent_map, rb_node); | 276 | em = rb_entry(prev, struct extent_map, rb_node); |
@@ -317,7 +317,7 @@ int remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em) | |||
317 | int ret = 0; | 317 | int ret = 0; |
318 | 318 | ||
319 | WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags)); | 319 | WARN_ON(test_bit(EXTENT_FLAG_PINNED, &em->flags)); |
320 | BUG_ON(spin_trylock(&tree->lock)); | 320 | assert_spin_locked(&tree->lock); |
321 | rb_erase(&em->rb_node, &tree->map); | 321 | rb_erase(&em->rb_node, &tree->map); |
322 | em->in_tree = 0; | 322 | em->in_tree = 0; |
323 | return ret; | 323 | return ret; |