btrfs: call functions that always use the same root with fs_info instead
There are many functions that are always called with the same root argument. Rather than passing the same root every time, we can pass an fs_info pointer instead and have the function get the root pointer itself. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
5b4aacefb8
commit
6bccf3ab1e
@@ -4179,7 +4179,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
|
||||
}
|
||||
btrfs_release_path(path);
|
||||
|
||||
ret = btrfs_del_root_ref(trans, root->fs_info->tree_root,
|
||||
ret = btrfs_del_root_ref(trans, root->fs_info,
|
||||
objectid, root->root_key.objectid,
|
||||
dir_ino, &index, name, name_len);
|
||||
if (ret < 0) {
|
||||
@@ -6296,7 +6296,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
|
||||
}
|
||||
|
||||
if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
|
||||
ret = btrfs_add_root_ref(trans, root->fs_info->tree_root,
|
||||
ret = btrfs_add_root_ref(trans, root->fs_info,
|
||||
key.objectid, root->root_key.objectid,
|
||||
parent_ino, index, name, name_len);
|
||||
} else if (add_backref) {
|
||||
@@ -6332,7 +6332,7 @@ fail_dir_item:
|
||||
if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
|
||||
u64 local_index;
|
||||
int err;
|
||||
err = btrfs_del_root_ref(trans, root->fs_info->tree_root,
|
||||
err = btrfs_del_root_ref(trans, root->fs_info,
|
||||
key.objectid, root->root_key.objectid,
|
||||
parent_ino, &local_index, name, name_len);
|
||||
|
||||
|
Reference in New Issue
Block a user