All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yingyi Luo <yingyil@google.com>
To: linux-btrfs@vger.kernel.org
Cc: drosen@google.com, yingyil <yingyil@google.com>
Subject: [PATCH 3/4 v2] btrfs-progs: mkfs: refactor create_data_reloc_tree
Date: Wed, 30 Aug 2017 10:24:49 -0700	[thread overview]
Message-ID: <20170830172450.27460-4-yingyil@google.com> (raw)
In-Reply-To: <20170830172450.27460-1-yingyil@google.com>

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(-)

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;
-- 
2.14.1.342.g6490525c54-goog


  parent reply	other threads:[~2017-08-30 17:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 23:21 [PATCH 0/1] btrfs-progs: mkfs: add subvolume support to mkfs Yingyi Luo
2017-08-25 23:21 ` [PATCH 1/1] " Yingyi Luo
2017-08-27 23:39   ` Qu Wenruo
2017-08-28 17:29     ` Goffredo Baroncelli
2017-08-29  2:04 ` [PATCH 0/1] " Anand Jain
2017-08-30 17:24 ` [PATCH 0/4 v2] " Yingyi Luo
2017-08-30 17:24   ` [PATCH 1/4 v2] btrfs-progs: convert: move link_subvol out of main Yingyi Luo
2017-09-12 17:25     ` David Sterba
2017-09-15 17:49     ` [PATCH 1/4 v3] " Yingyi Luo
2017-08-30 17:24   ` [PATCH 2/4 v2] btrfs-progs: add a parameter to btrfs_link_subvol Yingyi Luo
2017-09-12 17:28     ` David Sterba
2017-09-15 18:17     ` [PATCH 2/4 v3] btrfs-progs: add a parameter to btrfs_mksubvol Yingyi Luo
2017-08-30 17:24   ` Yingyi Luo [this message]
2017-09-12 17:29     ` [PATCH 3/4 v2] btrfs-progs: mkfs: refactor create_data_reloc_tree David Sterba
2017-08-30 17:24   ` [PATCH 4/4 v2] btrfs-progs: mkfs: add subvolume support to mkfs Yingyi Luo
2017-09-12 17:48     ` David Sterba
2017-09-29 13:47   ` [PATCH 0/4 v2] " David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170830172450.27460-4-yingyil@google.com \
    --to=yingyil@google.com \
    --cc=drosen@google.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.