summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_rmx.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
committerphk <phk@FreeBSD.org>1998-03-30 09:56:58 +0000
commit9b703b14551addf9806978973e2ddc427d4908b4 (patch)
tree91f2de8432f719153d0de9465a9ebeee33c29077 /sys/netinet/in_rmx.c
parentadd2782c4ec0d7c4447da2b33d1413a2754f8a3e (diff)
downloadFreeBSD-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/netinet/in_rmx.c')
-rw-r--r--sys/netinet/in_rmx.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index b0f24d7..3af35f2 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: in_rmx.c,v 1.32 1998/02/06 12:13:50 eivind Exp $
+ * $Id: in_rmx.c,v 1.33 1998/03/27 14:30:18 peter Exp $
*/
/*
@@ -202,7 +202,7 @@ in_clsroute(struct radix_node *rn, struct radix_node_head *head)
*/
if(rtq_reallyold != 0) {
rt->rt_flags |= RTPRF_OURS;
- rt->rt_rmx.rmx_expire = time.tv_sec + rtq_reallyold;
+ rt->rt_rmx.rmx_expire = time_second + rtq_reallyold;
} else {
rtrequest(RTM_DELETE,
(struct sockaddr *)rt_key(rt),
@@ -235,7 +235,7 @@ in_rtqkill(struct radix_node *rn, void *rock)
if(rt->rt_flags & RTPRF_OURS) {
ap->found++;
- if(ap->draining || rt->rt_rmx.rmx_expire <= time.tv_sec) {
+ if(ap->draining || rt->rt_rmx.rmx_expire <= time_second) {
if(rt->rt_refcnt > 0)
panic("rtqkill route really not free");
@@ -250,9 +250,9 @@ in_rtqkill(struct radix_node *rn, void *rock)
}
} else {
if(ap->updating
- && (rt->rt_rmx.rmx_expire - time.tv_sec
+ && (rt->rt_rmx.rmx_expire - time_second
> rtq_reallyold)) {
- rt->rt_rmx.rmx_expire = time.tv_sec
+ rt->rt_rmx.rmx_expire = time_second
+ rtq_reallyold;
}
ap->nextstop = lmin(ap->nextstop,
@@ -277,7 +277,7 @@ in_rtqtimo(void *rock)
arg.found = arg.killed = 0;
arg.rnh = rnh;
- arg.nextstop = time.tv_sec + rtq_timeout;
+ arg.nextstop = time_second + rtq_timeout;
arg.draining = arg.updating = 0;
s = splnet();
rnh->rnh_walktree(rnh, in_rtqkill, &arg);
@@ -292,14 +292,14 @@ in_rtqtimo(void *rock)
* hard.
*/
if((arg.found - arg.killed > rtq_toomany)
- && (time.tv_sec - last_adjusted_timeout >= rtq_timeout)
+ && (time_second - last_adjusted_timeout >= rtq_timeout)
&& rtq_reallyold > rtq_minreallyold) {
rtq_reallyold = 2*rtq_reallyold / 3;
if(rtq_reallyold < rtq_minreallyold) {
rtq_reallyold = rtq_minreallyold;
}
- last_adjusted_timeout = time.tv_sec;
+ last_adjusted_timeout = time_second;
#ifdef DIAGNOSTIC
log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n",
rtq_reallyold);
OpenPOWER on IntegriCloud