diff options
author | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-03-30 09:56:58 +0000 |
commit | 9b703b14551addf9806978973e2ddc427d4908b4 (patch) | |
tree | 91f2de8432f719153d0de9465a9ebeee33c29077 /sys/netatalk | |
parent | add2782c4ec0d7c4447da2b33d1413a2754f8a3e (diff) | |
download | FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.zip FreeBSD-src-9b703b14551addf9806978973e2ddc427d4908b4.tar.gz |
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
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/at_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c index 60f65ed..e15093a 100644 --- a/sys/netatalk/at_control.c +++ b/sys/netatalk/at_control.c @@ -446,7 +446,7 @@ at_ifinit( ifp, aa, sat ) * XXX use /dev/random? */ if ( nnets != 1 ) { - net = ntohs( nr.nr_firstnet ) + time.tv_sec % ( nnets - 1 ); + net = ntohs( nr.nr_firstnet ) + time_second % ( nnets - 1 ); } else { net = ntohs( nr.nr_firstnet ); } @@ -483,7 +483,7 @@ at_ifinit( ifp, aa, sat ) * XXX use /dev/random? */ if ( sat->sat_addr.s_node == ATADDR_ANYNODE ) { - AA_SAT( aa )->sat_addr.s_node = time.tv_sec; + AA_SAT( aa )->sat_addr.s_node = time_second; } else { AA_SAT( aa )->sat_addr.s_node = sat->sat_addr.s_node; } @@ -508,7 +508,7 @@ at_ifinit( ifp, aa, sat ) * Once again, starting at the (possibly random) * initial node address. */ - for ( j = 0, nodeinc = time.tv_sec | 1; j < 256; + for ( j = 0, nodeinc = time_second | 1; j < 256; j++, AA_SAT( aa )->sat_addr.s_node += nodeinc ) { if ( AA_SAT( aa )->sat_addr.s_node > 253 || AA_SAT( aa )->sat_addr.s_node < 1 ) { @@ -552,7 +552,7 @@ at_ifinit( ifp, aa, sat ) break; } /* reset node for next network */ - AA_SAT( aa )->sat_addr.s_node = time.tv_sec; + AA_SAT( aa )->sat_addr.s_node = time_second; } /* |