btrfs: Remove root argument of cleanup_transaction
[sfrench/cifs-2.6.git] / fs / btrfs / transaction.c
index f831251237fecae86f9a41de53201c7822dbcc86..ad7546745b5b4d24cffa86a8e9fe53dab31d5bc5 100644 (file)
@@ -1161,9 +1161,9 @@ static int update_cowonly_root(struct btrfs_trans_handle *trans,
  * failures will cause the file system to go offline. We still need
  * to clean up the delayed refs.
  */
-static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans,
-                                        struct btrfs_fs_info *fs_info)
+static noinline int commit_cowonly_roots(struct btrfs_trans_handle *trans)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct list_head *dirty_bgs = &trans->transaction->dirty_bgs;
        struct list_head *io_bgs = &trans->transaction->io_bgs;
        struct list_head *next;
@@ -1403,7 +1403,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
         * like chunk and root tree, as they won't affect qgroup.
         * And we don't write super to avoid half committed status.
         */
-       ret = commit_cowonly_roots(trans, fs_info);
+       ret = commit_cowonly_roots(trans);
        if (ret)
                goto out;
        switch_commit_roots(trans->transaction, fs_info);
@@ -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;
@@ -2203,7 +2202,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
                goto scrub_continue;
        }
 
-       ret = commit_cowonly_roots(trans, fs_info);
+       ret = commit_cowonly_roots(trans);
        if (ret) {
                mutex_unlock(&fs_info->tree_log_mutex);
                mutex_unlock(&fs_info->reloc_mutex);
@@ -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;
 }