Commit 729f7961 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: make btrfs_update_inode_fallback take btrfs_inode

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b06359a3
...@@ -3114,7 +3114,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, ...@@ -3114,7 +3114,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 inode *inode); struct btrfs_root *root, struct btrfs_inode *inode);
int btrfs_orphan_add(struct btrfs_trans_handle *trans, int btrfs_orphan_add(struct btrfs_trans_handle *trans,
struct btrfs_inode *inode); struct btrfs_inode *inode);
int btrfs_orphan_cleanup(struct btrfs_root *root); int btrfs_orphan_cleanup(struct btrfs_root *root);
......
...@@ -2771,7 +2771,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) ...@@ -2771,7 +2771,7 @@ static int btrfs_finish_ordered_io(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->vfs_inode); ret = btrfs_update_inode_fallback(trans, root, 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;
...@@ -2835,7 +2835,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) ...@@ -2835,7 +2835,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
0, 0, &cached_state); 0, 0, &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->vfs_inode); ret = btrfs_update_inode_fallback(trans, root, 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;
...@@ -3684,15 +3684,14 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans, ...@@ -3684,15 +3684,14 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
return btrfs_update_inode_item(trans, root, inode); return btrfs_update_inode_item(trans, root, inode);
} }
noinline 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_root *root, struct btrfs_inode *inode)
struct inode *inode)
{ {
int ret; int ret;
ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); ret = btrfs_update_inode(trans, root, inode);
if (ret == -ENOSPC) if (ret == -ENOSPC)
return btrfs_update_inode_item(trans, root, BTRFS_I(inode)); return btrfs_update_inode_item(trans, root, inode);
return ret; return ret;
} }
...@@ -3963,7 +3962,7 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, ...@@ -3963,7 +3962,7 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2); btrfs_i_size_write(BTRFS_I(dir), dir->i_size - name_len * 2);
inode_inc_iversion(dir); inode_inc_iversion(dir);
dir->i_mtime = dir->i_ctime = current_time(dir); dir->i_mtime = dir->i_ctime = current_time(dir);
ret = btrfs_update_inode_fallback(trans, root, dir); ret = btrfs_update_inode_fallback(trans, root, BTRFS_I(dir));
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
out: out:
......
...@@ -1721,7 +1721,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ...@@ -1721,7 +1721,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
dentry->d_name.len * 2); dentry->d_name.len * 2);
parent_inode->i_mtime = parent_inode->i_ctime = parent_inode->i_mtime = parent_inode->i_ctime =
current_time(parent_inode); current_time(parent_inode);
ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode); ret = btrfs_update_inode_fallback(trans, parent_root, BTRFS_I(parent_inode));
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment