btrfs: take an fs_info directly when the root is not used otherwise

There are loads of functions in btrfs that accept a root parameter
but only use it to obtain an fs_info pointer.  Let's convert those to
just accept an fs_info pointer directly.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Jeff Mahoney
2016-06-22 18:54:24 -04:00
committed by David Sterba
parent afdb571890
commit 2ff7e61e0d
44 changed files with 1119 additions and 1243 deletions

View File

@@ -1509,8 +1509,7 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans,
record->old_roots = NULL;
spin_lock(&delayed_refs->lock);
ret = btrfs_qgroup_trace_extent_nolock(fs_info, delayed_refs,
record);
ret = btrfs_qgroup_trace_extent_nolock(fs_info, delayed_refs, record);
spin_unlock(&delayed_refs->lock);
if (ret > 0)
kfree(record);
@@ -1518,10 +1517,9 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans,
}
int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_fs_info *fs_info,
struct extent_buffer *eb)
{
struct btrfs_fs_info *fs_info = root->fs_info;
int nr = btrfs_header_nritems(eb);
int i, extent_type, ret;
struct btrfs_key key;
@@ -1645,7 +1643,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
}
if (root_level == 0) {
ret = btrfs_qgroup_trace_leaf_items(trans, root, root_eb);
ret = btrfs_qgroup_trace_leaf_items(trans, fs_info, root_eb);
goto out;
}
@@ -1683,7 +1681,7 @@ walk_down:
child_bytenr = btrfs_node_blockptr(eb, parent_slot);
child_gen = btrfs_node_ptr_generation(eb, parent_slot);
eb = read_tree_block(root, child_bytenr, child_gen);
eb = read_tree_block(fs_info, child_bytenr, child_gen);
if (IS_ERR(eb)) {
ret = PTR_ERR(eb);
goto out;
@@ -1709,8 +1707,8 @@ walk_down:
}
if (level == 0) {
ret = btrfs_qgroup_trace_leaf_items(trans, root,
path->nodes[level]);
ret = btrfs_qgroup_trace_leaf_items(trans,fs_info,
path->nodes[level]);
if (ret)
goto out;