diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-05-22 12:33:42 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-22 12:33:42 -0400 |
commit | 945d8962ceee6bb273365d0bdf42f763225b290f (patch) | |
tree | 43f5617022c7c947c3c63664e49eb9575ab82f2f /fs/btrfs/ctree.c | |
parent | 0d0ca30f180906224be6279788f2b202cfd959d8 (diff) | |
parent | 4ea028859bbdad34b84c9951fbb832ae10c6a96c (diff) |
Merge branch 'cleanups' of git://repo.or.cz/linux-2.6/btrfs-unstable into inode_numbers
Conflicts:
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/inode.c
fs/btrfs/tree-log.c
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2736b6b2ff5f..b6cbeed226b1 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -102,7 +102,7 @@ void btrfs_free_path(struct btrfs_path *p) | |||
102 | { | 102 | { |
103 | if (!p) | 103 | if (!p) |
104 | return; | 104 | return; |
105 | btrfs_release_path(NULL, p); | 105 | btrfs_release_path(p); |
106 | kmem_cache_free(btrfs_path_cachep, p); | 106 | kmem_cache_free(btrfs_path_cachep, p); |
107 | } | 107 | } |
108 | 108 | ||
@@ -112,7 +112,7 @@ void btrfs_free_path(struct btrfs_path *p) | |||
112 | * | 112 | * |
113 | * It is safe to call this on paths that no locks or extent buffers held. | 113 | * It is safe to call this on paths that no locks or extent buffers held. |
114 | */ | 114 | */ |
115 | noinline void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p) | 115 | noinline void btrfs_release_path(struct btrfs_path *p) |
116 | { | 116 | { |
117 | int i; | 117 | int i; |
118 | 118 | ||
@@ -1323,7 +1323,7 @@ static noinline int reada_for_balance(struct btrfs_root *root, | |||
1323 | ret = -EAGAIN; | 1323 | ret = -EAGAIN; |
1324 | 1324 | ||
1325 | /* release the whole path */ | 1325 | /* release the whole path */ |
1326 | btrfs_release_path(root, path); | 1326 | btrfs_release_path(path); |
1327 | 1327 | ||
1328 | /* read the blocks */ | 1328 | /* read the blocks */ |
1329 | if (block1) | 1329 | if (block1) |
@@ -1470,7 +1470,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, | |||
1470 | return 0; | 1470 | return 0; |
1471 | } | 1471 | } |
1472 | free_extent_buffer(tmp); | 1472 | free_extent_buffer(tmp); |
1473 | btrfs_release_path(NULL, p); | 1473 | btrfs_release_path(p); |
1474 | return -EIO; | 1474 | return -EIO; |
1475 | } | 1475 | } |
1476 | } | 1476 | } |
@@ -1489,7 +1489,7 @@ read_block_for_search(struct btrfs_trans_handle *trans, | |||
1489 | if (p->reada) | 1489 | if (p->reada) |
1490 | reada_for_search(root, p, level, slot, key->objectid); | 1490 | reada_for_search(root, p, level, slot, key->objectid); |
1491 | 1491 | ||
1492 | btrfs_release_path(NULL, p); | 1492 | btrfs_release_path(p); |
1493 | 1493 | ||
1494 | ret = -EAGAIN; | 1494 | ret = -EAGAIN; |
1495 | tmp = read_tree_block(root, blocknr, blocksize, 0); | 1495 | tmp = read_tree_block(root, blocknr, blocksize, 0); |
@@ -1558,7 +1558,7 @@ setup_nodes_for_search(struct btrfs_trans_handle *trans, | |||
1558 | } | 1558 | } |
1559 | b = p->nodes[level]; | 1559 | b = p->nodes[level]; |
1560 | if (!b) { | 1560 | if (!b) { |
1561 | btrfs_release_path(NULL, p); | 1561 | btrfs_release_path(p); |
1562 | goto again; | 1562 | goto again; |
1563 | } | 1563 | } |
1564 | BUG_ON(btrfs_header_nritems(b) == 1); | 1564 | BUG_ON(btrfs_header_nritems(b) == 1); |
@@ -1748,7 +1748,7 @@ done: | |||
1748 | if (!p->leave_spinning) | 1748 | if (!p->leave_spinning) |
1749 | btrfs_set_path_blocking(p); | 1749 | btrfs_set_path_blocking(p); |
1750 | if (ret < 0) | 1750 | if (ret < 0) |
1751 | btrfs_release_path(root, p); | 1751 | btrfs_release_path(p); |
1752 | return ret; | 1752 | return ret; |
1753 | } | 1753 | } |
1754 | 1754 | ||
@@ -3021,7 +3021,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans, | |||
3021 | struct btrfs_file_extent_item); | 3021 | struct btrfs_file_extent_item); |
3022 | extent_len = btrfs_file_extent_num_bytes(leaf, fi); | 3022 | extent_len = btrfs_file_extent_num_bytes(leaf, fi); |
3023 | } | 3023 | } |
3024 | btrfs_release_path(root, path); | 3024 | btrfs_release_path(path); |
3025 | 3025 | ||
3026 | path->keep_locks = 1; | 3026 | path->keep_locks = 1; |
3027 | path->search_for_split = 1; | 3027 | path->search_for_split = 1; |
@@ -3641,7 +3641,6 @@ int setup_items_for_insert(struct btrfs_trans_handle *trans, | |||
3641 | 3641 | ||
3642 | ret = 0; | 3642 | ret = 0; |
3643 | if (slot == 0) { | 3643 | if (slot == 0) { |
3644 | struct btrfs_disk_key disk_key; | ||
3645 | btrfs_cpu_key_to_disk(&disk_key, cpu_key); | 3644 | btrfs_cpu_key_to_disk(&disk_key, cpu_key); |
3646 | ret = fixup_low_keys(trans, root, path, &disk_key, 1); | 3645 | ret = fixup_low_keys(trans, root, path, &disk_key, 1); |
3647 | } | 3646 | } |
@@ -3943,7 +3942,7 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path) | |||
3943 | else | 3942 | else |
3944 | return 1; | 3943 | return 1; |
3945 | 3944 | ||
3946 | btrfs_release_path(root, path); | 3945 | btrfs_release_path(path); |
3947 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); | 3946 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
3948 | if (ret < 0) | 3947 | if (ret < 0) |
3949 | return ret; | 3948 | return ret; |
@@ -4067,7 +4066,7 @@ find_next_key: | |||
4067 | sret = btrfs_find_next_key(root, path, min_key, level, | 4066 | sret = btrfs_find_next_key(root, path, min_key, level, |
4068 | cache_only, min_trans); | 4067 | cache_only, min_trans); |
4069 | if (sret == 0) { | 4068 | if (sret == 0) { |
4070 | btrfs_release_path(root, path); | 4069 | btrfs_release_path(path); |
4071 | goto again; | 4070 | goto again; |
4072 | } else { | 4071 | } else { |
4073 | goto out; | 4072 | goto out; |
@@ -4146,7 +4145,7 @@ next: | |||
4146 | btrfs_node_key_to_cpu(c, &cur_key, slot); | 4145 | btrfs_node_key_to_cpu(c, &cur_key, slot); |
4147 | 4146 | ||
4148 | orig_lowest = path->lowest_level; | 4147 | orig_lowest = path->lowest_level; |
4149 | btrfs_release_path(root, path); | 4148 | btrfs_release_path(path); |
4150 | path->lowest_level = level; | 4149 | path->lowest_level = level; |
4151 | ret = btrfs_search_slot(NULL, root, &cur_key, path, | 4150 | ret = btrfs_search_slot(NULL, root, &cur_key, path, |
4152 | 0, 0); | 4151 | 0, 0); |
@@ -4223,7 +4222,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path) | |||
4223 | again: | 4222 | again: |
4224 | level = 1; | 4223 | level = 1; |
4225 | next = NULL; | 4224 | next = NULL; |
4226 | btrfs_release_path(root, path); | 4225 | btrfs_release_path(path); |
4227 | 4226 | ||
4228 | path->keep_locks = 1; | 4227 | path->keep_locks = 1; |
4229 | 4228 | ||
@@ -4279,7 +4278,7 @@ again: | |||
4279 | goto again; | 4278 | goto again; |
4280 | 4279 | ||
4281 | if (ret < 0) { | 4280 | if (ret < 0) { |
4282 | btrfs_release_path(root, path); | 4281 | btrfs_release_path(path); |
4283 | goto done; | 4282 | goto done; |
4284 | } | 4283 | } |
4285 | 4284 | ||
@@ -4318,7 +4317,7 @@ again: | |||
4318 | goto again; | 4317 | goto again; |
4319 | 4318 | ||
4320 | if (ret < 0) { | 4319 | if (ret < 0) { |
4321 | btrfs_release_path(root, path); | 4320 | btrfs_release_path(path); |
4322 | goto done; | 4321 | goto done; |
4323 | } | 4322 | } |
4324 | 4323 | ||