Commit dfeb9e7c authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: make btrfs_update_inode_item 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 f3fbcaef
...@@ -3621,7 +3621,8 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, ...@@ -3621,7 +3621,8 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
* copy everything in the in-memory inode into the btree. * copy everything in the in-memory inode into the btree.
*/ */
static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans, static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct inode *inode) struct btrfs_root *root,
struct btrfs_inode *inode)
{ {
struct btrfs_inode_item *inode_item; struct btrfs_inode_item *inode_item;
struct btrfs_path *path; struct btrfs_path *path;
...@@ -3632,8 +3633,7 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans, ...@@ -3632,8 +3633,7 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
if (!path) if (!path)
return -ENOMEM; return -ENOMEM;
ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location, ret = btrfs_lookup_inode(trans, root, path, &inode->location, 1);
1);
if (ret) { if (ret) {
if (ret > 0) if (ret > 0)
ret = -ENOENT; ret = -ENOENT;
...@@ -3644,9 +3644,9 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans, ...@@ -3644,9 +3644,9 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
inode_item = btrfs_item_ptr(leaf, path->slots[0], inode_item = btrfs_item_ptr(leaf, path->slots[0],
struct btrfs_inode_item); struct btrfs_inode_item);
fill_inode_item(trans, leaf, inode_item, inode); fill_inode_item(trans, leaf, inode_item, &inode->vfs_inode);
btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf);
btrfs_set_inode_last_trans(trans, BTRFS_I(inode)); btrfs_set_inode_last_trans(trans, inode);
ret = 0; ret = 0;
failed: failed:
btrfs_free_path(path); btrfs_free_path(path);
...@@ -3680,7 +3680,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans, ...@@ -3680,7 +3680,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
return btrfs_update_inode_item(trans, root, inode); return btrfs_update_inode_item(trans, root, BTRFS_I(inode));
} }
noinline int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans, noinline int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
...@@ -3691,7 +3691,7 @@ noinline int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans, ...@@ -3691,7 +3691,7 @@ noinline int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
if (ret == -ENOSPC) if (ret == -ENOSPC)
return btrfs_update_inode_item(trans, root, inode); return btrfs_update_inode_item(trans, root, BTRFS_I(inode));
return ret; return ret;
} }
......
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