btrfs: Remove fs_info argument from switch_commit_roots
[sfrench/cifs-2.6.git] / fs / btrfs / transaction.c
index 6cba2b0c2b8a83a8308951232aedf91d835211e4..0d36337b0fcbecee191c7c6da68fa70b761831a6 100644 (file)
@@ -126,9 +126,9 @@ static void clear_btree_io_tree(struct extent_io_tree *tree)
        spin_unlock(&tree->lock);
 }
 
-static noinline void switch_commit_roots(struct btrfs_transaction *trans,
-                                        struct btrfs_fs_info *fs_info)
+static noinline void switch_commit_roots(struct btrfs_transaction *trans)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_root *root, *tmp;
 
        down_write(&fs_info->commit_root_sem);
@@ -1406,7 +1406,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
        ret = commit_cowonly_roots(trans);
        if (ret)
                goto out;
-       switch_commit_roots(trans->transaction, fs_info);
+       switch_commit_roots(trans->transaction);
        ret = btrfs_write_and_wait_transaction(trans, fs_info);
        if (ret)
                btrfs_handle_fs_error(fs_info, ret,
@@ -1867,10 +1867,9 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
 }
 
 
-static void cleanup_transaction(struct btrfs_trans_handle *trans,
-                               struct btrfs_root *root, int err)
+static void cleanup_transaction(struct btrfs_trans_handle *trans, int err)
 {
-       struct btrfs_fs_info *fs_info = root->fs_info;
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_transaction *cur_trans = trans->transaction;
        DEFINE_WAIT(wait);
 
@@ -1910,7 +1909,7 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
        btrfs_put_transaction(cur_trans);
        btrfs_put_transaction(cur_trans);
 
-       trace_btrfs_transaction_commit(root);
+       trace_btrfs_transaction_commit(trans->root);
 
        if (current->journal_info == trans)
                current->journal_info = NULL;
@@ -2235,7 +2234,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
        list_add_tail(&fs_info->chunk_root->dirty_list,
                      &cur_trans->switch_commits);
 
-       switch_commit_roots(cur_trans, fs_info);
+       switch_commit_roots(cur_trans);
 
        ASSERT(list_empty(&cur_trans->dirty_bgs));
        ASSERT(list_empty(&cur_trans->io_bgs));
@@ -2331,7 +2330,7 @@ cleanup_transaction:
        btrfs_warn(fs_info, "Skipping commit of aborted transaction.");
        if (current->journal_info == trans)
                current->journal_info = NULL;
-       cleanup_transaction(trans, trans->root, ret);
+       cleanup_transaction(trans, ret);
 
        return ret;
 }