mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[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>
This commit is contained in:
parent
dd954c69d1
commit
42fe2b1f7f
8 changed files with 49 additions and 54 deletions
|
@ -182,8 +182,8 @@ xfs_getattr(
|
|||
break;
|
||||
}
|
||||
|
||||
vap->va_atime.tv_sec = ip->i_d.di_atime.t_sec;
|
||||
vap->va_atime.tv_nsec = ip->i_d.di_atime.t_nsec;
|
||||
/* atime is only kept uptodate in the Linux inode */
|
||||
vap->va_atime = vp->v_inode.i_atime;
|
||||
vap->va_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
|
||||
vap->va_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec;
|
||||
vap->va_ctime.tv_sec = ip->i_d.di_ctime.t_sec;
|
||||
|
@ -982,10 +982,6 @@ xfs_readlink(
|
|||
goto error_return;
|
||||
}
|
||||
|
||||
if (!(ioflags & IO_INVIS)) {
|
||||
xfs_ichgtime(ip, XFS_ICHGTIME_ACC);
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the symlink is stored inline.
|
||||
*/
|
||||
|
@ -3226,7 +3222,6 @@ xfs_readdir(
|
|||
xfs_trans_t *tp = NULL;
|
||||
int error = 0;
|
||||
uint lock_mode;
|
||||
xfs_off_t start_offset;
|
||||
|
||||
vn_trace_entry(BHV_TO_VNODE(dir_bdp), __FUNCTION__,
|
||||
(inst_t *)__return_address);
|
||||
|
@ -3237,11 +3232,7 @@ xfs_readdir(
|
|||
}
|
||||
|
||||
lock_mode = xfs_ilock_map_shared(dp);
|
||||
start_offset = uiop->uio_offset;
|
||||
error = XFS_DIR_GETDENTS(dp->i_mount, tp, dp, uiop, eofp);
|
||||
if (start_offset != uiop->uio_offset) {
|
||||
xfs_ichgtime(dp, XFS_ICHGTIME_ACC);
|
||||
}
|
||||
xfs_iunlock_map_shared(dp, lock_mode);
|
||||
return error;
|
||||
}
|
||||
|
@ -3819,6 +3810,12 @@ xfs_reclaim(
|
|||
|
||||
ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);
|
||||
|
||||
/*
|
||||
* Make sure the atime in the XFS inode is correct before freeing the
|
||||
* Linux inode.
|
||||
*/
|
||||
xfs_synchronize_atime(ip);
|
||||
|
||||
/* If we have nothing to flush with this inode then complete the
|
||||
* teardown now, otherwise break the link between the xfs inode
|
||||
* and the linux inode and clean up the xfs inode later. This
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue