summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_inode.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>2004-06-24 19:35:28 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>2004-06-24 19:35:28 +0000
commitc6cc17e855e1d9fe177fba41d00de6e89fdc852e (patch)
treebdc6bde04c820ca59fe49d60185cf6ac40b44e30 /sys/ufs/ffs/ffs_inode.c
parent128dd71ffeec48b94e085c757b3626553d619e7c (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/ffs/ffs_inode.c')
-rw-r--r--sys/ufs/ffs/ffs_inode.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 6ace69141cd..364205824d8 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_inode.c,v 1.36 2003/11/19 03:29:31 mickey Exp $ */
+/* $OpenBSD: ffs_inode.c,v 1.37 2004/06/24 19:35:26 tholo Exp $ */
/* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */
/*
@@ -76,7 +76,7 @@ ffs_update(struct inode *ip, struct timespec *atime,
int error;
struct timespec ts;
- TIMEVAL_TO_TIMESPEC(&time, &ts);
+ getnanotime(&ts);
vp = ITOV(ip);
if (vp->v_mount->mnt_flag & MNT_RDONLY) {
ip->i_flag &=
@@ -100,8 +100,11 @@ ffs_update(struct inode *ip, struct timespec *atime,
ip->i_modrev++;
}
if (ip->i_flag & IN_CHANGE) {
- ip->i_ffs_ctime = time.tv_sec;
- ip->i_ffs_ctimensec = time.tv_usec * 1000;
+ struct timespec ts;
+
+ getnanotime(&ts);
+ ip->i_ffs_ctime = ts.tv_sec;
+ ip->i_ffs_ctimensec = ts.tv_nsec;
}
ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
fs = ip->i_fs;