aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver/nfsrvstats.h
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
commit227ee8a188f0f8da52dabd7c2c13748a2578efce (patch)
tree3bc7a5b892410dae1a4e23ebbc2cb43913cd6195 /sys/nfsserver/nfsrvstats.h
parent20344e15827694bd1a50248ac0c415925ed510e6 (diff)
downloadsrc-227ee8a188f0f8da52dabd7c2c13748a2578efce.tar.gz
src-227ee8a188f0f8da52dabd7c2c13748a2578efce.zip
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
Notes
Notes: svn path=/head/; revision=34961
Diffstat (limited to 'sys/nfsserver/nfsrvstats.h')
-rw-r--r--sys/nfsserver/nfsrvstats.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h
index 9f057a343ee6..8b28c003fa20 100644
--- a/sys/nfsserver/nfsrvstats.h
+++ b/sys/nfsserver/nfsrvstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.32 1997/10/12 20:25:38 phk Exp $
+ * $Id: nfs.h,v 1.33 1998/02/01 21:23:29 bde Exp $
*/
#ifndef _NFS_NFS_H_
@@ -108,9 +108,9 @@
*/
#define NFS_ATTRTIMEO(np) \
((((np)->n_flag & NMODIFIED) || \
- (time.tv_sec - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
- ((time.tv_sec - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
- (time.tv_sec - (np)->n_mtime) / 10))
+ (time_second - (np)->n_mtime) / 10 < NFS_MINATTRTIMO) ? NFS_MINATTRTIMO : \
+ ((time_second - (np)->n_mtime) / 10 > NFS_MAXATTRTIMO ? NFS_MAXATTRTIMO : \
+ (time_second - (np)->n_mtime) / 10))
/*
* Expected allocation sizes for major data structures. If the actual size
@@ -571,6 +571,7 @@ extern int nfs_debug;
#endif
+u_quad_t nfs_curusec __P((void));
int nfs_init __P((struct vfsconf *vfsp));
int nfs_reply __P((struct nfsreq *));
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));