aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-07-24 10:09:43 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:05 -0400
commit64f26f745084872b916cd1bef6054e21b15c5784 (patch)
tree1007982e9ed04b39ff98957f4eb527c88e87632f /fs
parentb3c3da71ed88c06bc18a4d8919c6e4af3b933566 (diff)
Btrfs: Use assert_spin_locked instead of spin_trylock
On UP systems spin_trylock always succeeds Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 8a502ee2f23..954b047639a 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;