summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 37adad5dabd6..df822908f2be 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -5809,30 +5809,28 @@ void btrfs_record_snapshot_destroy(struct btrfs_trans_handle *trans,
5809 * full transaction commit is required. 5809 * full transaction commit is required.
5810 */ 5810 */
5811int btrfs_log_new_name(struct btrfs_trans_handle *trans, 5811int btrfs_log_new_name(struct btrfs_trans_handle *trans,
5812 struct inode *inode, struct inode *old_dir, 5812 struct btrfs_inode *inode, struct btrfs_inode *old_dir,
5813 struct dentry *parent) 5813 struct dentry *parent)
5814{ 5814{
5815 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 5815 struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
5816 struct btrfs_root * root = BTRFS_I(inode)->root; 5816 struct btrfs_root * root = inode->root;
5817 5817
5818 /* 5818 /*
5819 * this will force the logging code to walk the dentry chain 5819 * this will force the logging code to walk the dentry chain
5820 * up for the file 5820 * up for the file
5821 */ 5821 */
5822 if (S_ISREG(inode->i_mode)) 5822 if (S_ISREG(inode->vfs_inode.i_mode))
5823 BTRFS_I(inode)->last_unlink_trans = trans->transid; 5823 inode->last_unlink_trans = trans->transid;
5824 5824
5825 /* 5825 /*
5826 * if this inode hasn't been logged and directory we're renaming it 5826 * if this inode hasn't been logged and directory we're renaming it
5827 * from hasn't been logged, we don't need to log it 5827 * from hasn't been logged, we don't need to log it
5828 */ 5828 */
5829 if (BTRFS_I(inode)->logged_trans <= 5829 if (inode->logged_trans <= fs_info->last_trans_committed &&
5830 fs_info->last_trans_committed && 5830 (!old_dir || old_dir->logged_trans <= fs_info->last_trans_committed))
5831 (!old_dir || BTRFS_I(old_dir)->logged_trans <=
5832 fs_info->last_trans_committed))
5833 return 0; 5831 return 0;
5834 5832
5835 return btrfs_log_inode_parent(trans, root, inode, parent, 0, 5833 return btrfs_log_inode_parent(trans, root, &inode->vfs_inode, parent, 0,
5836 LLONG_MAX, 1, NULL); 5834 LLONG_MAX, 1, NULL);
5837} 5835}
5838 5836