summaryrefslogtreecommitdiff
path: root/mkfs/main.c
diff options
context:
space:
mode:
authoryingyil <yingyil@google.com>2017-08-30 10:24:49 -0700
committerDavid Sterba <dsterba@suse.com>2017-09-25 15:17:39 +0200
commitf7267bc85c6d89d64b534b737c63cf8f88c46d7f (patch)
tree72c3e6b88d4f421d3a3db096ff1006b71f0d3253 /mkfs/main.c
parentbcaadc2e498f32a03ee694ac75ece0bb1a87c311 (diff)
btrfs-progs: mkfs: refactor create_data_reloc_tree
Add an objectid parameter to make the function a general one for inserting root items and rename it to create_tree. The change cascades down to the callchain. Signed-off-by: yingyil <yingyil@google.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'mkfs/main.c')
-rw-r--r--mkfs/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mkfs/main.c b/mkfs/main.c
index 7592c1fb..52bb1dad 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -321,13 +321,12 @@ static int create_raid_groups(struct btrfs_trans_handle *trans,
return ret;
}
-static int create_data_reloc_tree(struct btrfs_trans_handle *trans,
- struct btrfs_root *root)
+static int create_tree(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root, u64 objectid)
{
struct btrfs_key location;
struct btrfs_root_item root_item;
struct extent_buffer *tmp;
- u64 objectid = BTRFS_DATA_RELOC_TREE_OBJECTID;
int ret;
ret = btrfs_copy_root(trans, root, root->node, &tmp, objectid);
@@ -1857,7 +1856,7 @@ raid_groups:
}
}
- ret = create_data_reloc_tree(trans, root);
+ ret = create_tree(trans, root, BTRFS_DATA_RELOC_TREE_OBJECTID);
if (ret) {
error("unable to create data reloc tree: %d", ret);
goto out;