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/lfs | |
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/lfs')
-rw-r--r-- | sys/ufs/lfs/lfs_inode.c | 11 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_vnops.c | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/ufs/lfs/lfs_inode.c b/sys/ufs/lfs/lfs_inode.c index 0d39b5b418d..4e2c15c5dde 100644 --- a/sys/ufs/lfs/lfs_inode.c +++ b/sys/ufs/lfs/lfs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_inode.c,v 1.9 2003/06/02 23:28:23 millert Exp $ */ +/* $OpenBSD: lfs_inode.c,v 1.10 2004/06/24 19:35:27 tholo Exp $ */ /* $NetBSD: lfs_inode.c,v 1.5 1996/05/11 18:27:35 mycroft Exp $ */ /* @@ -102,8 +102,11 @@ lfs_update(v) (ip)->i_modrev++; } if (ip->i_flag & IN_CHANGE) { - ip->i_ctime = time.tv_sec; - ip->i_ctimensec = time.tv_usec * 1000; + struct timespec ts; + + getnanotime(&ts); + ip->i_ctime = ts.tv_sec; + ip->i_ctimensec = ts.tv_nsec; } ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); @@ -172,7 +175,7 @@ lfs_truncate(v) int e1, e2, depth, lastseg, num, offset, seg, freesize; ip = VTOI(vp); - TIMEVAL_TO_TIMESPEC(&time, &ts); + getnanotime(&ts); if (vp->v_type == VLNK && vp->v_mount->mnt_maxsymlinklen > 0) { #ifdef DIAGNOSTIC if (length != 0) diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index b0bf6c05aff..05f02d97493 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_vnops.c,v 1.10 2003/09/23 16:51:13 millert Exp $ */ +/* $OpenBSD: lfs_vnops.c,v 1.11 2004/06/24 19:35:27 tholo Exp $ */ /* $NetBSD: lfs_vnops.c,v 1.11 1996/05/11 18:27:41 mycroft Exp $ */ /* @@ -176,7 +176,7 @@ lfs_fsync(v) } */ *ap = v; struct timespec ts; - TIMEVAL_TO_TIMESPEC(&time, &ts); + getnanotime(&ts); return (VOP_UPDATE(ap->a_vp, &ts, &ts, ap->a_waitfor == MNT_WAIT ? LFS_SYNC : 0)); } |