btrfs: remove redundant root argument from btrfs_update_inode_fallback()

The root argument for btrfs_update_inode_fallback() always matches the
root of the given inode, so remove the root argument and get it from the
inode argument.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana 2023-09-22 11:37:21 +01:00 committed by David Sterba
parent cddaaacca9
commit 0a5d0dc55f
3 changed files with 8 additions and 8 deletions

View File

@ -484,7 +484,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
int btrfs_update_inode(struct btrfs_trans_handle *trans, int btrfs_update_inode(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_inode *inode); struct btrfs_root *root, struct btrfs_inode *inode);
int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans, int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_inode *inode); struct btrfs_inode *inode);
int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct btrfs_inode *inode); int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct btrfs_inode *inode);
int btrfs_orphan_cleanup(struct btrfs_root *root); int btrfs_orphan_cleanup(struct btrfs_root *root);
int btrfs_cont_expand(struct btrfs_inode *inode, loff_t oldsize, loff_t size); int btrfs_cont_expand(struct btrfs_inode *inode, loff_t oldsize, loff_t size);

View File

@ -3074,7 +3074,7 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
goto out; goto out;
} }
trans->block_rsv = &inode->block_rsv; trans->block_rsv = &inode->block_rsv;
ret = btrfs_update_inode_fallback(trans, root, inode); ret = btrfs_update_inode_fallback(trans, inode);
if (ret) /* -ENOMEM or corruption */ if (ret) /* -ENOMEM or corruption */
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto out; goto out;
@ -3144,7 +3144,7 @@ int btrfs_finish_one_ordered(struct btrfs_ordered_extent *ordered_extent)
&cached_state); &cached_state);
btrfs_inode_safe_disk_i_size_write(inode, 0); btrfs_inode_safe_disk_i_size_write(inode, 0);
ret = btrfs_update_inode_fallback(trans, root, inode); ret = btrfs_update_inode_fallback(trans, inode);
if (ret) { /* -ENOMEM or corruption */ if (ret) { /* -ENOMEM or corruption */
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto out; goto out;
@ -4030,13 +4030,13 @@ int btrfs_update_inode(struct btrfs_trans_handle *trans,
} }
int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans, int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_inode *inode) struct btrfs_inode *inode)
{ {
int ret; int ret;
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, inode->root, inode);
if (ret == -ENOSPC) if (ret == -ENOSPC)
return btrfs_update_inode_item(trans, root, inode); return btrfs_update_inode_item(trans, inode->root, inode);
return ret; return ret;
} }
@ -4316,7 +4316,7 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
btrfs_i_size_write(dir, dir->vfs_inode.i_size - fname.disk_name.len * 2); btrfs_i_size_write(dir, dir->vfs_inode.i_size - fname.disk_name.len * 2);
inode_inc_iversion(&dir->vfs_inode); inode_inc_iversion(&dir->vfs_inode);
dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode); dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode);
ret = btrfs_update_inode_fallback(trans, root, dir); ret = btrfs_update_inode_fallback(trans, dir);
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
out: out:

View File

@ -1951,7 +1951,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
btrfs_i_size_write(BTRFS_I(parent_inode), parent_inode->i_size + btrfs_i_size_write(BTRFS_I(parent_inode), parent_inode->i_size +
fname.disk_name.len * 2); fname.disk_name.len * 2);
parent_inode->i_mtime = inode_set_ctime_current(parent_inode); parent_inode->i_mtime = inode_set_ctime_current(parent_inode);
ret = btrfs_update_inode_fallback(trans, parent_root, BTRFS_I(parent_inode)); ret = btrfs_update_inode_fallback(trans, BTRFS_I(parent_inode));
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto fail; goto fail;