diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-03-09 11:45:38 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-03-09 11:45:38 -0400 |
commit | b9447ef80bd301b932ac4d85c9622e929de5fd62 (patch) | |
tree | 6d0bb1f287ed09f7850b77e2f622c3bebb35112b /fs/btrfs/ctree.c | |
parent | 4e06bdd6cbd5105376e7caf4e683ed131e777389 (diff) |
Btrfs: fix spinlock assertions on UP systems
btrfs_tree_locked was being used to make sure a given extent_buffer was
properly locked in a few places. But, it wasn't correct for UP compiled
kernels.
This switches it to using assert_spin_locked instead, and renames it to
btrfs_assert_tree_locked to better reflect how it was really being used.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 42491d728e99..37f31b5529aa 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -277,7 +277,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
277 | if (*cow_ret == buf) | 277 | if (*cow_ret == buf) |
278 | unlock_orig = 1; | 278 | unlock_orig = 1; |
279 | 279 | ||
280 | WARN_ON(!btrfs_tree_locked(buf)); | 280 | btrfs_assert_tree_locked(buf); |
281 | 281 | ||
282 | if (parent) | 282 | if (parent) |
283 | parent_start = parent->start; | 283 | parent_start = parent->start; |
@@ -2365,7 +2365,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2365 | if (slot >= btrfs_header_nritems(upper) - 1) | 2365 | if (slot >= btrfs_header_nritems(upper) - 1) |
2366 | return 1; | 2366 | return 1; |
2367 | 2367 | ||
2368 | WARN_ON(!btrfs_tree_locked(path->nodes[1])); | 2368 | btrfs_assert_tree_locked(path->nodes[1]); |
2369 | 2369 | ||
2370 | right = read_node_slot(root, upper, slot + 1); | 2370 | right = read_node_slot(root, upper, slot + 1); |
2371 | btrfs_tree_lock(right); | 2371 | btrfs_tree_lock(right); |
@@ -2562,7 +2562,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root | |||
2562 | if (right_nritems == 0) | 2562 | if (right_nritems == 0) |
2563 | return 1; | 2563 | return 1; |
2564 | 2564 | ||
2565 | WARN_ON(!btrfs_tree_locked(path->nodes[1])); | 2565 | btrfs_assert_tree_locked(path->nodes[1]); |
2566 | 2566 | ||
2567 | left = read_node_slot(root, path->nodes[1], slot - 1); | 2567 | left = read_node_slot(root, path->nodes[1], slot - 1); |
2568 | btrfs_tree_lock(left); | 2568 | btrfs_tree_lock(left); |
@@ -4101,7 +4101,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) | |||
4101 | 4101 | ||
4102 | next = read_node_slot(root, c, slot); | 4102 | next = read_node_slot(root, c, slot); |
4103 | if (!path->skip_locking) { | 4103 | if (!path->skip_locking) { |
4104 | WARN_ON(!btrfs_tree_locked(c)); | 4104 | btrfs_assert_tree_locked(c); |
4105 | btrfs_tree_lock(next); | 4105 | btrfs_tree_lock(next); |
4106 | btrfs_set_lock_blocking(next); | 4106 | btrfs_set_lock_blocking(next); |
4107 | } | 4107 | } |
@@ -4126,7 +4126,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) | |||
4126 | reada_for_search(root, path, level, slot, 0); | 4126 | reada_for_search(root, path, level, slot, 0); |
4127 | next = read_node_slot(root, next, 0); | 4127 | next = read_node_slot(root, next, 0); |
4128 | if (!path->skip_locking) { | 4128 | if (!path->skip_locking) { |
4129 | WARN_ON(!btrfs_tree_locked(path->nodes[level])); | 4129 | btrfs_assert_tree_locked(path->nodes[level]); |
4130 | btrfs_tree_lock(next); | 4130 | btrfs_tree_lock(next); |
4131 | btrfs_set_lock_blocking(next); | 4131 | btrfs_set_lock_blocking(next); |
4132 | } | 4132 | } |