diff options
author | bde <bde@FreeBSD.org> | 1997-03-22 06:53:45 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-03-22 06:53:45 +0000 |
commit | 0bc178170104cff1e818e849d08a50c6a4ee0851 (patch) | |
tree | 1a4787be89dc6587f785bb211bf92dd0ce277648 /sys/nfsserver | |
parent | 5610d80b6231f85421e587a175ddd4d4b0c735c5 (diff) | |
download | FreeBSD-src-0bc178170104cff1e818e849d08a50c6a4ee0851.zip FreeBSD-src-0bc178170104cff1e818e849d08a50c6a4ee0851.tar.gz |
Fixed some invalid (non-atomic) accesses to `time', mostly ones of the
form `tv = time'. Use a new function gettime(). The current version
just forces atomicicity without fixing precision or efficiency bugs.
Simplified some related valid accesses by using the central function.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 4 | ||||
-rw-r--r-- | sys/nfsserver/nfs_syscalls.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 2dbe371..a584d97 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 - * $Id$ + * $Id: nfs_socket.c,v 1.21 1997/02/22 09:42:39 peter Exp $ */ /* @@ -761,7 +761,7 @@ nfsmout: rt->srtt = nmp->nm_srtt[proct[rep->r_procnum] - 1]; rt->sdrtt = nmp->nm_sdrtt[proct[rep->r_procnum] - 1]; rt->fsid = nmp->nm_mountp->mnt_stat.f_fsid; - rt->tstamp = time; + gettime(&rt->tstamp); if (rep->r_flags & R_TIMING) rt->rtt = rep->r_rtt; else diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index cbcd695..83cd64d 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id$ + * $Id: nfs_syscalls.c,v 1.18 1997/02/22 09:42:42 peter Exp $ */ #include <sys/param.h> @@ -542,7 +542,7 @@ nfssvc_nfsd(nsd, argp, p) else solockp = (int *)0; if (nd) { - nd->nd_starttime = time; + gettime(&nd->nd_starttime); if (nd->nd_nam2) nd->nd_nam = nd->nd_nam2; else @@ -956,7 +956,7 @@ nfs_getnickauth(nmp, cred, auth_str, auth_len, verf_str, verf_len) if (time.tv_sec > nuidp->nu_timestamp.tv_sec || (time.tv_sec == nuidp->nu_timestamp.tv_sec && time.tv_usec > nuidp->nu_timestamp.tv_usec)) - nuidp->nu_timestamp = time; + gettime(&nuidp->nu_timestamp); else nuidp->nu_timestamp.tv_usec++; ktvin.tv_sec = txdr_unsigned(nuidp->nu_timestamp.tv_sec); @@ -1144,7 +1144,7 @@ nfsd_rt(sotype, nd, cacherep) rt->ipadr = INADDR_ANY; rt->resptime = ((time.tv_sec - nd->nd_starttime.tv_sec) * 1000000) + (time.tv_usec - nd->nd_starttime.tv_usec); - rt->tstamp = time; + gettime(&rt->tstamp); nfsdrt.pos = (nfsdrt.pos + 1) % NFSRTTLOGSIZ; } #endif /* NFS_NOSERVER */ |