From dfd9848c30c89d2bd43b93309c934a84cc254107 Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 3 Jul 1998 18:46:52 +0000 Subject: 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. --- sys/gnu/ext2fs/ext2_inode.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'sys/gnu/ext2fs') 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)), -- cgit v1.1