From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 02/11] btrfs-progs: check: Remove root parameter from btrfs_fix_block_accounting
Date: Mon, 28 May 2018 09:36:41 +0300 [thread overview]
Message-ID: <1527489410-3564-3-git-send-email-nborisov@suse.com> (raw)
In-Reply-To: <1527489410-3564-1-git-send-email-nborisov@suse.com>
It's always set to extent_root and the function already takes a
transaction handle where fs_info could be referenced and in turn
the extent_tree.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
check/main.c | 2 +-
check/mode-lowmem.c | 2 +-
ctree.h | 3 +--
extent-tree.c | 8 +++-----
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/check/main.c b/check/main.c
index 4cf243d9b379..71cc16735443 100644
--- a/check/main.c
+++ b/check/main.c
@@ -7671,7 +7671,7 @@ static int check_extent_refs(struct btrfs_root *root,
goto repair_abort;
}
- ret = btrfs_fix_block_accounting(trans, root);
+ ret = btrfs_fix_block_accounting(trans);
if (ret)
goto repair_abort;
ret = btrfs_commit_transaction(trans, root);
diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c
index 9890180d1d3c..410c5f635d4e 100644
--- a/check/mode-lowmem.c
+++ b/check/mode-lowmem.c
@@ -556,7 +556,7 @@ static int repair_block_accounting(struct btrfs_fs_info *fs_info)
return ret;
}
- ret = btrfs_fix_block_accounting(trans, root);
+ ret = btrfs_fix_block_accounting(trans);
btrfs_commit_transaction(trans, root);
return ret;
}
diff --git a/ctree.h b/ctree.h
index 697895a9e098..c833ad6998b9 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2500,8 +2500,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans,
u64 num_bytes, u64 empty_size,
u64 hint_byte, u64 search_end,
struct btrfs_key *ins, bool is_data);
-int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
- struct btrfs_root *root);
+int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans);
void btrfs_pin_extent(struct btrfs_fs_info *fs_info, u64 bytenr, u64 num_bytes);
void btrfs_unpin_extent(struct btrfs_fs_info *fs_info,
u64 bytenr, u64 num_bytes);
diff --git a/extent-tree.c b/extent-tree.c
index 1b8a4f8cb1c3..3132ccc8d44f 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -3788,8 +3788,7 @@ int btrfs_free_block_group(struct btrfs_trans_handle *trans,
* Fixup block accounting. The initial block accounting created by
* make_block_groups isn't accuracy in this case.
*/
-int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
- struct btrfs_root *root)
+int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans)
{
int ret = 0;
int slot;
@@ -3799,9 +3798,8 @@ int btrfs_fix_block_accounting(struct btrfs_trans_handle *trans,
struct btrfs_key key;
struct extent_buffer *leaf;
struct btrfs_block_group_cache *cache;
- struct btrfs_fs_info *fs_info = root->fs_info;
-
- root = root->fs_info->extent_root;
+ struct btrfs_fs_info *fs_info = trans->fs_info;
+ struct btrfs_root *root = fs_info->extent_root;
while(extent_root_pending_ops(fs_info)) {
ret = finish_current_insert(trans, root);
--
2.7.4
next prev parent reply other threads:[~2018-05-28 15:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-28 6:36 [PATCH 00/11] Summer argument cleanup Nikolay Borisov
2018-05-28 6:36 ` [PATCH 01/11] btrfs-progs: check: Remove root argument from delete_extent_records Nikolay Borisov
2018-05-28 6:36 ` Nikolay Borisov [this message]
2018-05-28 6:36 ` [PATCH 03/11] btrfs-progs: check: Remove root parameter from del_pending_extents Nikolay Borisov
2018-05-28 6:36 ` [PATCH 04/11] btrfs-progs: check: Remove root argument from finish_current_insert Nikolay Borisov
2018-05-28 6:36 ` [PATCH 05/11] btrfs-progs: check: Make update_pinned_extents take btrfs_fs_info Nikolay Borisov
2018-05-28 6:36 ` [PATCH 06/11] btrfs-progs: Remove unused argument from clean_tree_block Nikolay Borisov
2018-05-28 6:36 ` [PATCH 07/11] btrfs-progs: check: Remove unused root argument from btrfs_extent_post_op Nikolay Borisov
2018-05-28 6:36 ` [PATCH 08/11] btrfs-progs: Change btrfs_root to btrfs_fs_info argument in btrfs_lookup_extent_info Nikolay Borisov
2018-05-28 6:36 ` [PATCH 09/11] btrfs-progs: Remove root argument from btrfs_set_block_flags Nikolay Borisov
2018-05-28 6:36 ` [PATCH 10/11] btrfs-progs: Remove root argument from write_one_cache_group Nikolay Borisov
2018-05-28 6:36 ` [PATCH 11/11] btrfs-progs: Remove fs_info argument from write_ctree_super Nikolay Borisov
2018-05-29 1:06 ` [PATCH 00/11] Summer argument cleanup Lu Fengqi
2018-05-31 11:34 ` 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=1527489410-3564-3-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).