diff options
author | bde <bde@FreeBSD.org> | 1998-07-03 18:46:52 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-07-03 18:46:52 +0000 |
commit | dfd9848c30c89d2bd43b93309c934a84cc254107 (patch) | |
tree | 9d19fdccc10074893d94a205159868f759b143ad /sys/gnu/ext2fs | |
parent | e15057ae7cfa8d8f9f129ea1ec98514ab36f269d (diff) | |
download | FreeBSD-src-dfd9848c30c89d2bd43b93309c934a84cc254107.zip FreeBSD-src-dfd9848c30c89d2bd43b93309c934a84cc254107.tar.gz |
Centralized in-core inode update. Update the in-core inode directly
in ufs_setattr() so that there is no need to pass timestamps to
UFS_UPDATE() (everything else just needs the current time). Ignore
the passed-in timestamps in UFS_UPDATE() and always call ufs_itimes()
(was: itimes()) to do the update. The timestamps are still passed
so that all the callers don't need to be changed yet.
Diffstat (limited to 'sys/gnu/ext2fs')
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c index f6cc413..a094ad2 100644 --- a/sys/gnu/ext2fs/ext2_inode.c +++ b/sys/gnu/ext2fs/ext2_inode.c @@ -91,25 +91,13 @@ ext2_update(vp, access, modify, waitfor) struct inode *ip; int error; + ufs_itimes(vp); ip = VTOI(vp); - if (vp->v_mount->mnt_flag & MNT_RDONLY) { - ip->i_flag &= - ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE); + if ((ip->i_flag & IN_MODIFIED) == 0) return (0); - } - if ((ip->i_flag & - (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) + ip->i_flag &= ~IN_MODIFIED; + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (0); - if (ip->i_flag & IN_ACCESS) - ip->i_atime = access->tv_sec; - if (ip->i_flag & IN_UPDATE) { - ip->i_mtime = modify->tv_sec; - ip->i_modrev++; - } - if (ip->i_flag & IN_CHANGE) { - ip->i_ctime = time_second; - } - ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE); fs = ip->i_e2fs; if (error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), |