diff options
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vnops.c | 10 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 7 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 7 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 9 |
4 files changed, 18 insertions, 15 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index 34e242ee4c0..aa5b14efebf 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vnops.c,v 1.48 2007/06/17 20:15:25 jasper Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.49 2007/09/23 20:15:07 millert Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -300,11 +300,13 @@ ext2fs_setattr(void *v) ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) - ip->i_flag |= IN_ACCESS; if (vap->va_mtime.tv_sec != VNOVAL) ip->i_flag |= IN_CHANGE | IN_UPDATE; + if (vap->va_atime.tv_sec != VNOVAL) { + if (!(vp->v_mount->mnt_flag & MNT_NOATIME) || + (ip->i_flag & (IN_CHANGE | IN_UPDATE))) + ip->i_flag |= IN_ACCESS; + } error = ext2fs_update(ip, &vap->va_atime, &vap->va_mtime, 1); if (error) return (error); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 7949d379845..f91d87ec8e7 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_inode.c,v 1.49 2007/06/01 18:54:27 pedro Exp $ */ +/* $OpenBSD: ffs_inode.c,v 1.50 2007/09/23 20:15:07 millert Exp $ */ /* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */ /* @@ -81,11 +81,6 @@ ffs_update(struct inode *ip, struct timespec *atime, return (0); } - if ((vp->v_mount->mnt_flag & MNT_NOATIME) && - !(ip->i_flag & (IN_CHANGE | IN_UPDATE))) { - ip->i_flag &= ~IN_ACCESS; - } - if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && waitfor != MNT_WAIT) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index a40b641c200..57e398d8c21 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vnops.c,v 1.45 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: ffs_vnops.c,v 1.46 2007/09/23 20:15:07 millert Exp $ */ /* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */ /* @@ -249,7 +249,10 @@ ffs_read(void *v) } if (bp != NULL) brelse(bp); - ip->i_flag |= IN_ACCESS; + if (!(vp->v_mount->mnt_flag & MNT_NOATIME) || + (ip->i_flag & (IN_CHANGE | IN_UPDATE))) { + ip->i_flag |= IN_ACCESS; + } return (error); } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 59afe3bafd2..f19b064aa2b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.82 2007/06/20 15:03:40 thib Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.83 2007/09/23 20:15:07 millert Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -390,10 +390,13 @@ ufs_setattr(void *v) ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, p)))) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - ip->i_flag |= IN_ACCESS; if (vap->va_mtime.tv_sec != VNOVAL) ip->i_flag |= IN_CHANGE | IN_UPDATE; + if (vap->va_atime.tv_sec != VNOVAL) { + if (!(vp->v_mount->mnt_flag & MNT_NOATIME) || + (ip->i_flag & (IN_CHANGE | IN_UPDATE))) + ip->i_flag |= IN_ACCESS; + } error = UFS_UPDATE2(ip, &vap->va_atime, &vap->va_mtime, 0); if (error) return (error); |