btrfs: remove root parameter from transaction commit/end routines

Now we only use the root parameter to print the root objectid in
a tracepoint.  We can use the root parameter from the transaction
handle for that.  It's also used to join the transaction with
async commits, so we remove the comment that it's just for checking.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Jeff Mahoney
2016-09-09 21:39:03 -04:00
committed by David Sterba
parent bf89d38feb
commit 3a45bb207e
22 changed files with 188 additions and 211 deletions

View File

@@ -2270,7 +2270,7 @@ static noinline_for_stack int merge_reloc_root(struct reloc_control *rc,
path->slots[level]);
root_item->drop_level = level;
btrfs_end_transaction_throttle(trans, root);
btrfs_end_transaction_throttle(trans);
trans = NULL;
btrfs_btree_balance_dirty(fs_info);
@@ -2301,7 +2301,7 @@ out:
}
if (trans)
btrfs_end_transaction_throttle(trans, root);
btrfs_end_transaction_throttle(trans);
btrfs_btree_balance_dirty(fs_info);
@@ -2346,7 +2346,7 @@ again:
if (!err) {
if (num_bytes != rc->merging_rsv_size) {
btrfs_end_transaction(trans, rc->extent_root);
btrfs_end_transaction(trans);
btrfs_block_rsv_release(fs_info, rc->block_rsv,
num_bytes);
goto again;
@@ -2378,9 +2378,9 @@ again:
list_splice(&reloc_roots, &rc->reloc_roots);
if (!err)
btrfs_commit_transaction(trans, rc->extent_root);
btrfs_commit_transaction(trans);
else
btrfs_end_transaction(trans, rc->extent_root);
btrfs_end_transaction(trans);
return err;
}
@@ -3555,7 +3555,7 @@ truncate:
ret = btrfs_truncate_free_space_cache(root, trans, block_group, inode);
btrfs_end_transaction(trans, root);
btrfs_end_transaction(trans);
btrfs_btree_balance_dirty(fs_info);
out:
iput(inode);
@@ -3986,7 +3986,7 @@ int prepare_to_relocate(struct reloc_control *rc)
*/
return PTR_ERR(trans);
}
btrfs_commit_transaction(trans, rc->extent_root);
btrfs_commit_transaction(trans);
return 0;
}
@@ -4033,7 +4033,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
}
restart:
if (update_backref_cache(trans, &rc->backref_cache)) {
btrfs_end_transaction(trans, rc->extent_root);
btrfs_end_transaction(trans);
continue;
}
@@ -4121,7 +4121,7 @@ restart:
}
}
btrfs_end_transaction_throttle(trans, rc->extent_root);
btrfs_end_transaction_throttle(trans);
btrfs_btree_balance_dirty(fs_info);
trans = NULL;
@@ -4150,7 +4150,7 @@ restart:
clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY);
if (trans) {
btrfs_end_transaction_throttle(trans, rc->extent_root);
btrfs_end_transaction_throttle(trans);
btrfs_btree_balance_dirty(fs_info);
}
@@ -4181,7 +4181,7 @@ restart:
err = PTR_ERR(trans);
goto out_free;
}
btrfs_commit_transaction(trans, rc->extent_root);
btrfs_commit_transaction(trans);
out_free:
btrfs_free_block_rsv(fs_info, rc->block_rsv);
btrfs_free_path(path);
@@ -4257,7 +4257,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
err = btrfs_orphan_add(trans, inode);
out:
btrfs_end_transaction(trans, root);
btrfs_end_transaction(trans);
btrfs_btree_balance_dirty(fs_info);
if (err) {
if (inode)
@@ -4442,7 +4442,7 @@ static noinline_for_stack int mark_garbage_root(struct btrfs_root *root)
ret = btrfs_update_root(trans, fs_info->tree_root,
&root->root_key, &root->root_item);
err = btrfs_end_transaction(trans, fs_info->tree_root);
err = btrfs_end_transaction(trans);
if (err)
return err;
return ret;
@@ -4573,7 +4573,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
fs_root->reloc_root = reloc_root;
}
err = btrfs_commit_transaction(trans, rc->extent_root);
err = btrfs_commit_transaction(trans);
if (err)
goto out_free;
@@ -4586,7 +4586,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
err = PTR_ERR(trans);
goto out_free;
}
err = btrfs_commit_transaction(trans, rc->extent_root);
err = btrfs_commit_transaction(trans);
out_free:
kfree(rc);
out: