diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-21 10:40:19 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-12-06 16:06:57 +0100 |
commit | 5b4aacefb8fbfc996e68b9b083d30f8bc0972449 (patch) | |
tree | cd4f1669a5bf9f8f2896c27f4b0d9d51e8a68e43 /fs/btrfs/transaction.c | |
parent | 515bdc479097ec9d5f389202842345af3162f71c (diff) | |
download | linux-next-5b4aacefb8fbfc996e68b9b083d30f8bc0972449.tar.gz |
btrfs: call functions that overwrite their root parameter with fs_info
There are 11 functions that accept a root parameter and immediately
overwrite it. We can pass those an fs_info pointer instead.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 9517de0e668c..88be1f812391 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1219,10 +1219,9 @@ void btrfs_add_dead_root(struct btrfs_root *root) * update all the cowonly tree roots on disk */ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, - struct btrfs_root *root) + struct btrfs_fs_info *fs_info) { struct btrfs_root *gang[8]; - struct btrfs_fs_info *fs_info = root->fs_info; int i; int ret; int err = 0; @@ -1236,7 +1235,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans, if (ret == 0) break; for (i = 0; i < ret; i++) { - root = gang[i]; + struct btrfs_root *root = gang[i]; radix_tree_tag_clear(&fs_info->fs_roots_radix, (unsigned long)root->root_key.objectid, BTRFS_ROOT_TRANS_TAG); @@ -1343,7 +1342,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, */ mutex_lock(&fs_info->tree_log_mutex); - ret = commit_fs_roots(trans, src); + ret = commit_fs_roots(trans, fs_info); if (ret) goto out; ret = btrfs_qgroup_prepare_account_extents(trans, fs_info); @@ -2132,7 +2131,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, */ mutex_lock(&root->fs_info->tree_log_mutex); - ret = commit_fs_roots(trans, root); + ret = commit_fs_roots(trans, root->fs_info); if (ret) { mutex_unlock(&root->fs_info->tree_log_mutex); mutex_unlock(&root->fs_info->reloc_mutex); |