summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_serv.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/nfs/nfs_serv.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/nfs/nfs_serv.c')
-rw-r--r--sys/nfs/nfs_serv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 928eb898aec..853369c71f5 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.37 2004/05/14 04:00:34 tedu Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.38 2004/06/24 19:35:26 tholo Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -885,6 +885,7 @@ nfsrv_writegather(ndp, slp, procp, mrq)
struct vnode *vp;
struct uio io, *uiop = &io;
u_quad_t frev, cur_usec;
+ struct timeval tv;
*mrq = NULL;
if (*ndp) {
@@ -898,7 +899,8 @@ nfsrv_writegather(ndp, slp, procp, mrq)
LIST_INIT(&nfsd->nd_coalesce);
nfsd->nd_mreq = NULL;
nfsd->nd_stable = NFSV3WRITE_FILESYNC;
- cur_usec = (u_quad_t)time.tv_sec * 1000000 + (u_quad_t)time.tv_usec;
+ getmicrotime(&tv);
+ cur_usec = (u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec;
nfsd->nd_time = cur_usec + nfsrvw_procrastinate;
/*
@@ -1010,7 +1012,8 @@ nfsmout:
* and generate the associated reply mbuf list(s).
*/
loop1:
- cur_usec = (u_quad_t)time.tv_sec * 1000000 + (u_quad_t)time.tv_usec;
+ getmicrotime(&tv);
+ cur_usec = (u_quad_t)tv.tv_sec * 1000000 + (u_quad_t)tv.tv_usec;
s = splsoftclock();
for (nfsd = LIST_FIRST(&slp->ns_tq); nfsd != NULL; nfsd = owp) {
owp = LIST_NEXT(nfsd, nd_tq);