btrfs-progs: check: Remove root parameter from btrfs_fix_block_accounting

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>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2018-05-28 09:36:41 +03:00 committed by David Sterba
parent 48663d6e64
commit b4c4ff9c4a
5 changed files with 7 additions and 10 deletions

View File

@ -7671,7 +7671,7 @@ repair_abort:
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);

View File

@ -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;
}

View File

@ -957,7 +957,7 @@ static int init_btrfs(struct btrfs_mkfs_config *cfg, struct btrfs_root *root,
ret = PTR_ERR(trans);
goto err;
}
ret = btrfs_fix_block_accounting(trans, root);
ret = btrfs_fix_block_accounting(trans);
if (ret)
goto err;
ret = make_convert_data_block_groups(trans, fs_info, cfg, cctx);

View File

@ -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);

View File

@ -3788,8 +3788,7 @@ out:
* 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);