diff mbox

[3/4,v2] btrfs-progs: mkfs: refactor create_data_reloc_tree

Message ID 20170830172450.27460-4-yingyil@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yingyi Luo Aug. 30, 2017, 5:24 p.m. UTC
From: yingyil <yingyil@google.com>

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>
---
v2: utilize create_tree() function for creating a subvolume, instead of
create_subvol() in convert/main.c.

 mkfs/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

David Sterba Sept. 12, 2017, 5:29 p.m. UTC | #1
On Wed, Aug 30, 2017 at 10:24:49AM -0700, Yingyi Luo wrote:
> From: yingyil <yingyil@google.com>
> 
> 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>

The patch is independent of the others, applied. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/mkfs/main.c b/mkfs/main.c
index afd68bc5..869c11fa 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -320,13 +320,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);
@@ -1846,7 +1845,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;