btrfs: btrfs_abort_transaction, drop root parameter
__btrfs_abort_transaction doesn't use its root parameter except to obtain an fs_info pointer. We can obtain that from trans->root->fs_info for now and from trans->fs_info in a later patch. 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
64b6358072
commit
66642832f0
@@ -561,7 +561,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
new_root = btrfs_read_fs_root_no_name(root->fs_info, &key);
|
||||
if (IS_ERR(new_root)) {
|
||||
ret = PTR_ERR(new_root);
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -570,7 +570,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
ret = btrfs_create_subvol_root(trans, new_root, root, new_dirid);
|
||||
if (ret) {
|
||||
/* We potentially lose an unused inode item here */
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
*/
|
||||
ret = btrfs_set_inode_index(dir, &index);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
name, namelen, dir, &key,
|
||||
BTRFS_FT_DIR, index);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ static noinline int create_subvol(struct inode *dir,
|
||||
root_item->uuid, BTRFS_UUID_KEY_SUBVOL,
|
||||
objectid);
|
||||
if (ret)
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
|
||||
fail:
|
||||
kfree(root_item);
|
||||
@@ -2488,7 +2488,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
|
||||
dentry->d_name.len);
|
||||
if (ret) {
|
||||
err = ret;
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto out_end_trans;
|
||||
}
|
||||
|
||||
@@ -2504,7 +2504,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
|
||||
root->fs_info->tree_root,
|
||||
dest->root_key.objectid);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
err = ret;
|
||||
goto out_end_trans;
|
||||
}
|
||||
@@ -2514,7 +2514,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
|
||||
dest->root_item.uuid, BTRFS_UUID_KEY_SUBVOL,
|
||||
dest->root_key.objectid);
|
||||
if (ret && ret != -ENOENT) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
err = ret;
|
||||
goto out_end_trans;
|
||||
}
|
||||
@@ -2524,7 +2524,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
|
||||
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
|
||||
dest->root_key.objectid);
|
||||
if (ret && ret != -ENOENT) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
err = ret;
|
||||
goto out_end_trans;
|
||||
}
|
||||
@@ -3291,7 +3291,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans,
|
||||
|
||||
ret = btrfs_update_inode(trans, root, inode);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
btrfs_end_transaction(trans, root);
|
||||
goto out;
|
||||
}
|
||||
@@ -3693,7 +3693,7 @@ process_slot:
|
||||
if (ret) {
|
||||
if (ret != -EOPNOTSUPP)
|
||||
btrfs_abort_transaction(trans,
|
||||
root, ret);
|
||||
ret);
|
||||
btrfs_end_transaction(trans, root);
|
||||
goto out;
|
||||
}
|
||||
@@ -3701,8 +3701,7 @@ process_slot:
|
||||
ret = btrfs_insert_empty_item(trans, root, path,
|
||||
&new_key, size);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans, root,
|
||||
ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
btrfs_end_transaction(trans, root);
|
||||
goto out;
|
||||
}
|
||||
@@ -3734,7 +3733,6 @@ process_slot:
|
||||
new_key.offset - datao);
|
||||
if (ret) {
|
||||
btrfs_abort_transaction(trans,
|
||||
root,
|
||||
ret);
|
||||
btrfs_end_transaction(trans,
|
||||
root);
|
||||
@@ -3771,7 +3769,6 @@ process_slot:
|
||||
if (ret) {
|
||||
if (ret != -EOPNOTSUPP)
|
||||
btrfs_abort_transaction(trans,
|
||||
root,
|
||||
ret);
|
||||
btrfs_end_transaction(trans, root);
|
||||
goto out;
|
||||
@@ -3827,7 +3824,7 @@ process_slot:
|
||||
last_dest_end, destoff + len, 1);
|
||||
if (ret) {
|
||||
if (ret != -EOPNOTSUPP)
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
btrfs_end_transaction(trans, root);
|
||||
goto out;
|
||||
}
|
||||
@@ -5163,13 +5160,13 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
|
||||
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
|
||||
root->root_key.objectid);
|
||||
if (ret < 0 && ret != -EEXIST) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
ret = btrfs_commit_transaction(trans, root);
|
||||
if (ret < 0) {
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
btrfs_abort_transaction(trans, ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user