mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-12 16:59:51 +00:00
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:
parent
48663d6e64
commit
b4c4ff9c4a
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
3
ctree.h
3
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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user