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

btrfs: make btrfs_set_inode_last_trans take btrfs_inode

Instead of making multiple calls to BTRFS_I simply take btrfs_inode as
an input paramter.
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 056d9bec
...@@ -3481,7 +3481,7 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans, ...@@ -3481,7 +3481,7 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
fill_inode_item(trans, leaf, inode_item, inode); fill_inode_item(trans, leaf, inode_item, inode);
btrfs_mark_buffer_dirty(leaf); btrfs_mark_buffer_dirty(leaf);
btrfs_set_inode_last_trans(trans, inode); btrfs_set_inode_last_trans(trans, BTRFS_I(inode));
ret = 0; ret = 0;
failed: failed:
btrfs_free_path(path); btrfs_free_path(path);
...@@ -3511,7 +3511,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans, ...@@ -3511,7 +3511,7 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
ret = btrfs_delayed_update_inode(trans, root, inode); ret = btrfs_delayed_update_inode(trans, root, inode);
if (!ret) if (!ret)
btrfs_set_inode_last_trans(trans, inode); btrfs_set_inode_last_trans(trans, BTRFS_I(inode));
return ret; return ret;
} }
...@@ -6053,7 +6053,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, ...@@ -6053,7 +6053,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
inode_tree_add(inode); inode_tree_add(inode);
trace_btrfs_inode_new(inode); trace_btrfs_inode_new(inode);
btrfs_set_inode_last_trans(trans, inode); btrfs_set_inode_last_trans(trans, BTRFS_I(inode));
btrfs_update_root_times(trans, root); btrfs_update_root_times(trans, root);
......
...@@ -156,13 +156,13 @@ struct btrfs_pending_snapshot { ...@@ -156,13 +156,13 @@ struct btrfs_pending_snapshot {
}; };
static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans, static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans,
struct inode *inode) struct btrfs_inode *inode)
{ {
spin_lock(&BTRFS_I(inode)->lock); spin_lock(&inode->lock);
BTRFS_I(inode)->last_trans = trans->transaction->transid; inode->last_trans = trans->transaction->transid;
BTRFS_I(inode)->last_sub_trans = BTRFS_I(inode)->root->log_transid; inode->last_sub_trans = inode->root->log_transid;
BTRFS_I(inode)->last_log_commit = BTRFS_I(inode)->root->last_log_commit; inode->last_log_commit = inode->root->last_log_commit;
spin_unlock(&BTRFS_I(inode)->lock); spin_unlock(&inode->lock);
} }
/* /*
......
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