diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-14 19:54:12 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-10-02 11:14:54 -0400 |
commit | 4d75f8a9c87b843c8ded15b82b8d137b9724cccc (patch) | |
tree | a6ac5d4fee70795507ccdebe83f92b6c28ab2d27 /fs/btrfs/ctree.c | |
parent | 0308af4465897c889e32754ef37bb465a1b2b872 (diff) |
btrfs: remove blocksize from btrfs_alloc_free_block and rename
Rename to btrfs_alloc_tree_block as it fits to the alloc/find/free +
_tree_block family. The parameter blocksize was set to the metadata
block size, directly or indirectly.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 2fb4ab659a0f..d498982bd202 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -258,9 +258,8 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
258 | else | 258 | else |
259 | btrfs_node_key(buf, &disk_key, 0); | 259 | btrfs_node_key(buf, &disk_key, 0); |
260 | 260 | ||
261 | cow = btrfs_alloc_free_block(trans, root, buf->len, 0, | 261 | cow = btrfs_alloc_tree_block(trans, root, 0, new_root_objectid, |
262 | new_root_objectid, &disk_key, level, | 262 | &disk_key, level, buf->start, 0); |
263 | buf->start, 0); | ||
264 | if (IS_ERR(cow)) | 263 | if (IS_ERR(cow)) |
265 | return PTR_ERR(cow); | 264 | return PTR_ERR(cow); |
266 | 265 | ||
@@ -1133,9 +1132,9 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
1133 | } else | 1132 | } else |
1134 | parent_start = 0; | 1133 | parent_start = 0; |
1135 | 1134 | ||
1136 | cow = btrfs_alloc_free_block(trans, root, buf->len, parent_start, | 1135 | cow = btrfs_alloc_tree_block(trans, root, parent_start, |
1137 | root->root_key.objectid, &disk_key, | 1136 | root->root_key.objectid, &disk_key, level, |
1138 | level, search_start, empty_size); | 1137 | search_start, empty_size); |
1139 | if (IS_ERR(cow)) | 1138 | if (IS_ERR(cow)) |
1140 | return PTR_ERR(cow); | 1139 | return PTR_ERR(cow); |
1141 | 1140 | ||
@@ -3355,9 +3354,8 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, | |||
3355 | else | 3354 | else |
3356 | btrfs_node_key(lower, &lower_key, 0); | 3355 | btrfs_node_key(lower, &lower_key, 0); |
3357 | 3356 | ||
3358 | c = btrfs_alloc_free_block(trans, root, root->nodesize, 0, | 3357 | c = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid, |
3359 | root->root_key.objectid, &lower_key, | 3358 | &lower_key, level, root->node->start, 0); |
3360 | level, root->node->start, 0); | ||
3361 | if (IS_ERR(c)) | 3359 | if (IS_ERR(c)) |
3362 | return PTR_ERR(c); | 3360 | return PTR_ERR(c); |
3363 | 3361 | ||
@@ -3495,9 +3493,8 @@ static noinline int split_node(struct btrfs_trans_handle *trans, | |||
3495 | mid = (c_nritems + 1) / 2; | 3493 | mid = (c_nritems + 1) / 2; |
3496 | btrfs_node_key(c, &disk_key, mid); | 3494 | btrfs_node_key(c, &disk_key, mid); |
3497 | 3495 | ||
3498 | split = btrfs_alloc_free_block(trans, root, root->nodesize, 0, | 3496 | split = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid, |
3499 | root->root_key.objectid, | 3497 | &disk_key, level, c->start, 0); |
3500 | &disk_key, level, c->start, 0); | ||
3501 | if (IS_ERR(split)) | 3498 | if (IS_ERR(split)) |
3502 | return PTR_ERR(split); | 3499 | return PTR_ERR(split); |
3503 | 3500 | ||
@@ -4275,9 +4272,8 @@ again: | |||
4275 | else | 4272 | else |
4276 | btrfs_item_key(l, &disk_key, mid); | 4273 | btrfs_item_key(l, &disk_key, mid); |
4277 | 4274 | ||
4278 | right = btrfs_alloc_free_block(trans, root, root->nodesize, 0, | 4275 | right = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid, |
4279 | root->root_key.objectid, | 4276 | &disk_key, 0, l->start, 0); |
4280 | &disk_key, 0, l->start, 0); | ||
4281 | if (IS_ERR(right)) | 4277 | if (IS_ERR(right)) |
4282 | return PTR_ERR(right); | 4278 | return PTR_ERR(right); |
4283 | 4279 | ||