diff options
author | Christoph Hellwig <hch@sgi.com> | 2006-01-10 23:35:17 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-01-10 23:35:17 -0500 |
commit | 42fe2b1f7fe788ed5304a7bfa0a0b0db81bc03a8 (patch) | |
tree | bbf454c788e4370faf569fdf51893529b3f71ab3 /fs/xfs/xfs_vnodeops.c | |
parent | dd954c69d189cd91571b42d3f926e70351395dc3 (diff) |
[XFS] fix, speedup and simplify atime handling let the VFS handle atime
updates and only sync back to the xfs inode when nessecary
SGI-PV: 946679
SGI-Modid: xfs-linux-melb:xfs-kern:203362a
Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 15734c54952e..688fc2cb4b8d 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -182,8 +182,8 @@ xfs_getattr( | |||
182 | break; | 182 | break; |
183 | } | 183 | } |
184 | 184 | ||
185 | vap->va_atime.tv_sec = ip->i_d.di_atime.t_sec; | 185 | /* atime is only kept uptodate in the Linux inode */ |
186 | vap->va_atime.tv_nsec = ip->i_d.di_atime.t_nsec; | 186 | vap->va_atime = vp->v_inode.i_atime; |
187 | vap->va_mtime.tv_sec = ip->i_d.di_mtime.t_sec; | 187 | vap->va_mtime.tv_sec = ip->i_d.di_mtime.t_sec; |
188 | vap->va_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; | 188 | vap->va_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; |
189 | vap->va_ctime.tv_sec = ip->i_d.di_ctime.t_sec; | 189 | vap->va_ctime.tv_sec = ip->i_d.di_ctime.t_sec; |
@@ -982,10 +982,6 @@ xfs_readlink( | |||
982 | goto error_return; | 982 | goto error_return; |
983 | } | 983 | } |
984 | 984 | ||
985 | if (!(ioflags & IO_INVIS)) { | ||
986 | xfs_ichgtime(ip, XFS_ICHGTIME_ACC); | ||
987 | } | ||
988 | |||
989 | /* | 985 | /* |
990 | * See if the symlink is stored inline. | 986 | * See if the symlink is stored inline. |
991 | */ | 987 | */ |
@@ -3226,7 +3222,6 @@ xfs_readdir( | |||
3226 | xfs_trans_t *tp = NULL; | 3222 | xfs_trans_t *tp = NULL; |
3227 | int error = 0; | 3223 | int error = 0; |
3228 | uint lock_mode; | 3224 | uint lock_mode; |
3229 | xfs_off_t start_offset; | ||
3230 | 3225 | ||
3231 | vn_trace_entry(BHV_TO_VNODE(dir_bdp), __FUNCTION__, | 3226 | vn_trace_entry(BHV_TO_VNODE(dir_bdp), __FUNCTION__, |
3232 | (inst_t *)__return_address); | 3227 | (inst_t *)__return_address); |
@@ -3237,11 +3232,7 @@ xfs_readdir( | |||
3237 | } | 3232 | } |
3238 | 3233 | ||
3239 | lock_mode = xfs_ilock_map_shared(dp); | 3234 | lock_mode = xfs_ilock_map_shared(dp); |
3240 | start_offset = uiop->uio_offset; | ||
3241 | error = XFS_DIR_GETDENTS(dp->i_mount, tp, dp, uiop, eofp); | 3235 | error = XFS_DIR_GETDENTS(dp->i_mount, tp, dp, uiop, eofp); |
3242 | if (start_offset != uiop->uio_offset) { | ||
3243 | xfs_ichgtime(dp, XFS_ICHGTIME_ACC); | ||
3244 | } | ||
3245 | xfs_iunlock_map_shared(dp, lock_mode); | 3236 | xfs_iunlock_map_shared(dp, lock_mode); |
3246 | return error; | 3237 | return error; |
3247 | } | 3238 | } |
@@ -3819,6 +3810,12 @@ xfs_reclaim( | |||
3819 | 3810 | ||
3820 | ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0); | 3811 | ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0); |
3821 | 3812 | ||
3813 | /* | ||
3814 | * Make sure the atime in the XFS inode is correct before freeing the | ||
3815 | * Linux inode. | ||
3816 | */ | ||
3817 | xfs_synchronize_atime(ip); | ||
3818 | |||
3822 | /* If we have nothing to flush with this inode then complete the | 3819 | /* If we have nothing to flush with this inode then complete the |
3823 | * teardown now, otherwise break the link between the xfs inode | 3820 | * teardown now, otherwise break the link between the xfs inode |
3824 | * and the linux inode and clean up the xfs inode later. This | 3821 | * and the linux inode and clean up the xfs inode later. This |