diff options
author | pfg <pfg@FreeBSD.org> | 2016-02-19 15:53:08 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-02-19 15:53:08 +0000 |
commit | e6b8864942931926eef37e5d00816ac85552f3c2 (patch) | |
tree | 4d2de21c4f27e18f86c40e51011abdbd2a53917e | |
parent | a97d0cb74368d59b0f42a232f0939e03234a1f9e (diff) | |
download | FreeBSD-src-e6b8864942931926eef37e5d00816ac85552f3c2.zip FreeBSD-src-e6b8864942931926eef37e5d00816ac85552f3c2.tar.gz |
Ext2: cleanup setting of ctime/mtime/birthtime.
This adopts the same change as r291936 for UFS.
Directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and
copy the value into the inode.
This keeps the behaviour cleaner and is consistent with UFS.
Reviewed by: bde
MFC after: 1 month (only 10)
-rw-r--r-- | sys/fs/ext2fs/ext2_vnops.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index 42e11c7..7c4d3ae 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -464,16 +464,14 @@ ext2_setattr(struct vop_setattr_args *ap) ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || (error = VOP_ACCESS(vp, VWRITE, cred, td)))) 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; - ext2_itimes(vp); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; if (vap->va_atime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_ACCESS; ip->i_atime = vap->va_atime.tv_sec; ip->i_atimensec = vap->va_atime.tv_nsec; } if (vap->va_mtime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_UPDATE; ip->i_mtime = vap->va_mtime.tv_sec; ip->i_mtimensec = vap->va_mtime.tv_nsec; } |