diff options
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index d6947f818f29..0e7ca2155956 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -97,17 +97,23 @@ xfs_ichgtime( | |||
97 | { | 97 | { |
98 | struct inode *inode = VFS_I(ip); | 98 | struct inode *inode = VFS_I(ip); |
99 | timespec_t tv; | 99 | timespec_t tv; |
100 | int sync_it = 0; | ||
100 | 101 | ||
101 | nanotime(&tv); | 102 | tv = current_fs_time(inode->i_sb); |
102 | if (flags & XFS_ICHGTIME_MOD) { | 103 | |
104 | if ((flags & XFS_ICHGTIME_MOD) && | ||
105 | !timespec_equal(&inode->i_mtime, &tv)) { | ||
103 | inode->i_mtime = tv; | 106 | inode->i_mtime = tv; |
104 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; | 107 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; |
105 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; | 108 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; |
109 | sync_it = 1; | ||
106 | } | 110 | } |
107 | if (flags & XFS_ICHGTIME_CHG) { | 111 | if ((flags & XFS_ICHGTIME_CHG) && |
112 | !timespec_equal(&inode->i_ctime, &tv)) { | ||
108 | inode->i_ctime = tv; | 113 | inode->i_ctime = tv; |
109 | ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; | 114 | ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; |
110 | ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; | 115 | ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; |
116 | sync_it = 1; | ||
111 | } | 117 | } |
112 | 118 | ||
113 | /* | 119 | /* |
@@ -119,10 +125,11 @@ xfs_ichgtime( | |||
119 | * ensure that the compiler does not reorder the update | 125 | * ensure that the compiler does not reorder the update |
120 | * of i_update_core above the timestamp updates above. | 126 | * of i_update_core above the timestamp updates above. |
121 | */ | 127 | */ |
122 | SYNCHRONIZE(); | 128 | if (sync_it) { |
123 | ip->i_update_core = 1; | 129 | SYNCHRONIZE(); |
124 | if (!(inode->i_state & I_NEW)) | 130 | ip->i_update_core = 1; |
125 | mark_inode_dirty_sync(inode); | 131 | mark_inode_dirty_sync(inode); |
132 | } | ||
126 | } | 133 | } |
127 | 134 | ||
128 | /* | 135 | /* |