diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 2004-06-24 19:35:28 +0000 |
commit | c6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch) | |
tree | bdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/ufs/ext2fs | |
parent | 128dd71ffeec48b94e085c757b3626553d619e7c (diff) |
This moves access to wall and uptime variables in MI code,
encapsulating all such access into wall-defined functions
that makes sure locking is done as needed.
It also cleans up some uses of wall time vs. uptime some
places, but there is sure to be more of these needed as
well, particularily in MD code. Also, many current calls
to microtime() should probably be changed to getmicrotime(),
or to the {,get}microuptime() versions.
ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others
"Oh, that is not your problem!" from miod@
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_inode.c | 6 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vnops.c | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index 5a9c898ac54..05978497fdf 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.24 2003/08/25 23:26:55 tedu Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.25 2004/06/24 19:35:26 tholo Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */ /* @@ -88,7 +88,7 @@ ext2fs_inactive(v) if (ip->i_e2fs_size != 0) { error = ext2fs_truncate(ip, (off_t)0, 0, NOCRED); } - TIMEVAL_TO_TIMESPEC(&time, &ts); + getnanotime(&ts); ip->i_e2fs_dtime = ts.tv_sec; ip->i_flag |= IN_CHANGE | IN_UPDATE; ext2fs_inode_free(ip, ip->i_number, ip->i_e2fs_mode); @@ -129,7 +129,7 @@ ext2fs_update(struct inode *ip, struct timespec *atime, struct timespec *mtime, if (ITOV(ip)->v_mount->mnt_flag & MNT_RDONLY) return (0); - TIMEVAL_TO_TIMESPEC(&time, &ts); + getnanotime(&ts); EXT2FS_ITIMES(ip, atime ? atime : &ts, mtime ? mtime : &ts); diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index db8f6fc7553..c40edb65315 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.34 2004/05/14 04:00:34 tedu Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.35 2004/06/24 19:35:26 tholo Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -216,8 +216,10 @@ ext2fs_getattr(v) register struct vnode *vp = ap->a_vp; register struct inode *ip = VTOI(vp); register struct vattr *vap = ap->a_vap; + struct timeval tv; - EXT2FS_ITIMES(ip, &time, &time); + getmicrotime(&tv); + EXT2FS_ITIMES(ip, &tv, &tv); /* * Copy from inode table */ |