Commit 26ffe53e authored by Nathan Scott's avatar Nathan Scott

[XFS] Use vnode timespec modifiers for atime/mtime/ctime, keeps last code hunk in sync.

SGI Modid: 2.5.x-xfs:slinx:162783a
parent 0d39ce1f
...@@ -586,6 +586,13 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag) ...@@ -586,6 +586,13 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag)
spin_unlock(&vp->v_lock); spin_unlock(&vp->v_lock);
} }
/*
* Update modify/access/change times on the vnode
*/
#define VN_MTIMESET(vp, tvp) (LINVFS_GET_IP(vp)->i_mtime = *(tvp))
#define VN_ATIMESET(vp, tvp) (LINVFS_GET_IP(vp)->i_atime = *(tvp))
#define VN_CTIMESET(vp, tvp) (LINVFS_GET_IP(vp)->i_ctime = *(tvp))
/* /*
* Some useful predicates. * Some useful predicates.
*/ */
......
...@@ -3799,7 +3799,7 @@ xfs_ichgtime(xfs_inode_t *ip, ...@@ -3799,7 +3799,7 @@ xfs_ichgtime(xfs_inode_t *ip,
* We're not supposed to change timestamps in readonly-mounted * We're not supposed to change timestamps in readonly-mounted
* filesystems. Throw it away if anyone asks us. * filesystems. Throw it away if anyone asks us.
*/ */
if (vp->v_vfsp->vfs_flag & VFS_RDONLY) if (unlikely(vp->v_vfsp->vfs_flag & VFS_RDONLY))
return; return;
/* /*
...@@ -3813,17 +3813,17 @@ xfs_ichgtime(xfs_inode_t *ip, ...@@ -3813,17 +3813,17 @@ xfs_ichgtime(xfs_inode_t *ip,
nanotime(&tv); nanotime(&tv);
if (flags & XFS_ICHGTIME_MOD) { if (flags & XFS_ICHGTIME_MOD) {
inode->i_mtime = tv; VN_MTIMESET(vp, &tv);
ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
} }
if (flags & XFS_ICHGTIME_ACC) { if (flags & XFS_ICHGTIME_ACC) {
inode->i_atime = tv; VN_ATIMESET(vp, &tv);
ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec; ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec;
} }
if (flags & XFS_ICHGTIME_CHG) { if (flags & XFS_ICHGTIME_CHG) {
inode->i_ctime = tv; VN_CTIMESET(vp, &tv);
ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment