diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 3bfb3c0f8e29..37bb1012aff1 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -64,14 +64,14 @@ xfs_synchronize_atime( | |||
64 | { | 64 | { |
65 | struct inode *inode = VFS_I(ip); | 65 | struct inode *inode = VFS_I(ip); |
66 | 66 | ||
67 | if (inode) { | 67 | if (!(inode->i_state & I_CLEAR)) { |
68 | ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; | 68 | ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; |
69 | ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; | 69 | ip->i_d.di_atime.t_nsec = (__int32_t)inode->i_atime.tv_nsec; |
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * If the linux inode exists, mark it dirty. | 74 | * If the linux inode is valid, mark it dirty. |
75 | * Used when commiting a dirty inode into a transaction so that | 75 | * Used when commiting a dirty inode into a transaction so that |
76 | * the inode will get written back by the linux code | 76 | * the inode will get written back by the linux code |
77 | */ | 77 | */ |
@@ -81,7 +81,7 @@ xfs_mark_inode_dirty_sync( | |||
81 | { | 81 | { |
82 | struct inode *inode = VFS_I(ip); | 82 | struct inode *inode = VFS_I(ip); |
83 | 83 | ||
84 | if (inode) | 84 | if (!(inode->i_state & (I_WILL_FREE|I_FREEING|I_CLEAR))) |
85 | mark_inode_dirty_sync(inode); | 85 | mark_inode_dirty_sync(inode); |
86 | } | 86 | } |
87 | 87 | ||
@@ -766,12 +766,21 @@ xfs_diflags_to_iflags( | |||
766 | * When reading existing inodes from disk this is called directly | 766 | * When reading existing inodes from disk this is called directly |
767 | * from xfs_iget, when creating a new inode it is called from | 767 | * from xfs_iget, when creating a new inode it is called from |
768 | * xfs_ialloc after setting up the inode. | 768 | * xfs_ialloc after setting up the inode. |
769 | * | ||
770 | * We are always called with an uninitialised linux inode here. | ||
771 | * We need to initialise the necessary fields and take a reference | ||
772 | * on it. | ||
769 | */ | 773 | */ |
770 | void | 774 | void |
771 | xfs_setup_inode( | 775 | xfs_setup_inode( |
772 | struct xfs_inode *ip) | 776 | struct xfs_inode *ip) |
773 | { | 777 | { |
774 | struct inode *inode = ip->i_vnode; | 778 | struct inode *inode = &ip->i_vnode; |
779 | |||
780 | inode->i_ino = ip->i_ino; | ||
781 | inode->i_state = I_NEW|I_LOCK; | ||
782 | inode_add_to_lists(ip->i_mount->m_super, inode); | ||
783 | ASSERT(atomic_read(&inode->i_count) == 1); | ||
775 | 784 | ||
776 | inode->i_mode = ip->i_d.di_mode; | 785 | inode->i_mode = ip->i_d.di_mode; |
777 | inode->i_nlink = ip->i_d.di_nlink; | 786 | inode->i_nlink = ip->i_d.di_nlink; |