linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 4/8] btrfs-progs: Make btrfs_write_dirty_block_groups take only trans argument
Date: Thu, 16 Aug 2018 16:10:31 +0300	[thread overview]
Message-ID: <1534425035-323-5-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1534425035-323-1-git-send-email-nborisov@suse.com>

The root argument is used only to get a reference to the fs_info, this
can be achieved with the transaction handle being passed so use that.
This is in preparation for moving this function in the main transaction
commit routine. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 ctree.h       | 3 +--
 extent-tree.c | 5 ++---
 transaction.c | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/ctree.h b/ctree.h
index 5242595fe355..75675ef3f781 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2523,8 +2523,7 @@ int btrfs_update_extent_ref(struct btrfs_trans_handle *trans,
 			    u64 orig_parent, u64 parent,
 			    u64 root_objectid, u64 ref_generation,
 			    u64 owner_objectid);
-int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
-				    struct btrfs_root *root);
+int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans);
 int btrfs_free_block_groups(struct btrfs_fs_info *info);
 int btrfs_read_block_groups(struct btrfs_root *root);
 struct btrfs_block_group_cache *
diff --git a/extent-tree.c b/extent-tree.c
index 3356dd2e4cf6..7d6c37c6b371 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1727,8 +1727,7 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans,
 
 }
 
-int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
-				   struct btrfs_root *root)
+int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans)
 {
 	struct extent_io_tree *block_group_cache;
 	struct btrfs_block_group_cache *cache;
@@ -1739,7 +1738,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
 	u64 end;
 	u64 ptr;
 
-	block_group_cache = &root->fs_info->block_group_cache;
+	block_group_cache = &trans->fs_info->block_group_cache;
 	path = btrfs_alloc_path();
 	if (!path)
 		return -ENOMEM;
diff --git a/transaction.c b/transaction.c
index ecafbb156610..96d9891b0d1c 100644
--- a/transaction.c
+++ b/transaction.c
@@ -61,7 +61,7 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
 	u64 old_root_bytenr;
 	struct btrfs_root *tree_root = root->fs_info->tree_root;
 
-	btrfs_write_dirty_block_groups(trans, root);
+	btrfs_write_dirty_block_groups(trans);
 	while(1) {
 		old_root_bytenr = btrfs_root_bytenr(&root->root_item);
 		if (old_root_bytenr == root->node->start)
@@ -75,7 +75,7 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
 					&root->root_key,
 					&root->root_item);
 		BUG_ON(ret);
-		btrfs_write_dirty_block_groups(trans, root);
+		btrfs_write_dirty_block_groups(trans);
 	}
 	return 0;
 }
-- 
2.7.4

  parent reply	other threads:[~2018-08-16 16:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 13:10 [PATCH 0/8 V2] Add delayed-refs support to btrfs-progs Nikolay Borisov
2018-08-16 13:10 ` [PATCH 1/8] btrfs-progs: Add __free_extent2 function Nikolay Borisov
2018-08-16 13:10 ` [PATCH 2/8] btrfs-progs: Add alloc_reserved_tree_block2 function Nikolay Borisov
2018-08-16 13:10 ` [PATCH 3/8] btrfs-progs: Add delayed refs infrastructure Nikolay Borisov
2018-08-16 13:10 ` Nikolay Borisov [this message]
2018-08-16 13:10 ` [PATCH 5/8] btrfs-progs: Wire up delayed refs Nikolay Borisov
2018-09-05  2:10   ` Qu Wenruo
2018-09-05  5:42     ` Nikolay Borisov
2018-09-05  5:53       ` Qu Wenruo
2018-09-05  7:41         ` Nikolay Borisov
2018-09-05  7:46           ` Qu Wenruo
2018-09-05  7:50             ` Nikolay Borisov
2018-08-16 13:10 ` [PATCH 6/8] btrfs-progs: Remove old delayed refs infrastructure Nikolay Borisov
2018-08-16 13:10 ` [PATCH 7/8] btrfs-progs: Remove __free_extent2 Nikolay Borisov
2018-08-16 13:10 ` [PATCH 8/8] btrfs-progs: Merge alloc_reserved_tree_block(2|) Nikolay Borisov
2018-09-14 15:28 ` [PATCH 0/8 V2] Add delayed-refs support to btrfs-progs 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=1534425035-323-5-git-send-email-nborisov@suse.com \
    --to=nborisov@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).