summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2009-05-22 00:19:26 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2009-05-22 00:19:26 +0000
commite234642b3559a3fd14435aeed2fb56e142bd9691 (patch)
tree19d4c9d0019bdd6c2692a311702d06fda51af512 /sys
parentae8a031e28803ad11c91125bd1523348d0f9aba7 (diff)
retire the nfs rtt log code, this isnt really all that
usefull, and has been disabled for a long long time. Cleans house a bit. OK blambert@
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs.h3
-rw-r--r--sys/nfs/nfs_socket.c24
-rw-r--r--sys/nfs/nfs_subs.c6
-rw-r--r--sys/nfs/nfs_syscalls.c48
-rw-r--r--sys/nfs/nfsrtt.h101
5 files changed, 5 insertions, 177 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h
index cf21dc38787..4ca42223266 100644
--- a/sys/nfs/nfs.h
+++ b/sys/nfs/nfs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs.h,v 1.39 2009/05/21 12:24:22 thib Exp $ */
+/* $OpenBSD: nfs.h,v 1.40 2009/05/22 00:19:25 thib Exp $ */
/* $NetBSD: nfs.h,v 1.10.4.1 1996/05/27 11:23:56 fvdl Exp $ */
/*
@@ -345,7 +345,6 @@ struct nfsrv_descript {
int nd_len; /* Length of this write */
int nd_repstat; /* Reply status */
u_int32_t nd_retxid; /* Reply xid */
- struct timeval nd_starttime; /* Time RPC initiated */
fhandle_t nd_fh; /* File handle */
struct ucred nd_cr; /* Credentials */
};
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 5ffc771fbbd..04d6364a4db 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.79 2009/05/15 12:07:18 thib Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.80 2009/05/22 00:19:25 thib Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -66,7 +66,6 @@
#include <nfs/nfsm_subs.h>
#include <nfs/nfsmount.h>
#include <nfs/nfsnode.h>
-#include <nfs/nfsrtt.h>
#include <nfs/nfs_var.h>
/*
@@ -127,8 +126,6 @@ static int proct[NFS_NPROCS] = {
#define NFS_CWNDSCALE 256
#define NFS_MAXCWND (NFS_CWNDSCALE * 32)
static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, };
-int nfsrtton = 0;
-struct nfsrtt nfsrtt;
void nfs_realign(struct mbuf **, int);
void nfs_realign_fixup(struct mbuf *, struct mbuf *, unsigned int *);
@@ -727,24 +724,7 @@ nfsmout:
rep->r_mrep = mrep;
rep->r_md = md;
rep->r_dpos = dpos;
- if (nfsrtton) {
- struct rttl *rt;
-
- rt = &nfsrtt.rttl[nfsrtt.pos];
- rt->proc = rep->r_procnum;
- rt->rto = NFS_RTO(nmp, proct[rep->r_procnum]);
- rt->sent = nmp->nm_sent;
- rt->cwnd = nmp->nm_cwnd;
- 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;
- getmicrotime(&rt->tstamp);
- if (rep->r_flags & R_TIMING)
- rt->rtt = rep->r_rtt;
- else
- rt->rtt = 1000000;
- nfsrtt.pos = (nfsrtt.pos + 1) % NFSRTTLOGSIZ;
- }
+
/*
* Update congestion window.
* Do the additive increase of
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 39e650671d7..ead5679fbf5 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.94 2009/04/13 17:51:57 blambert Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.95 2009/05/22 00:19:25 thib Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -64,7 +64,6 @@
#include <nfs/xdr_subs.h>
#include <nfs/nfsm_subs.h>
#include <nfs/nfsmount.h>
-#include <nfs/nfsrtt.h>
#include <nfs/nfs_var.h>
#include <miscfs/specfs/specdev.h>
@@ -514,8 +513,6 @@ static short *nfsrv_v3errmap[] = {
nfsv3err_commit,
};
-extern struct nfsrtt nfsrtt;
-
struct pool nfsreqpl;
/*
@@ -913,7 +910,6 @@ nfs_init()
{
static struct timeout nfs_timer_to;
- nfsrtt.pos = 0;
rpc_vers = txdr_unsigned(RPC_VER2);
rpc_call = txdr_unsigned(RPC_CALL);
rpc_reply = txdr_unsigned(RPC_REPLY);
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index c6cfac17ca0..eecf47b6db6 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.76 2009/01/28 12:02:00 bluhm Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.77 2009/05/22 00:19:25 thib Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -70,12 +70,10 @@
#include <nfs/nfsrvcache.h>
#include <nfs/nfsmount.h>
#include <nfs/nfsnode.h>
-#include <nfs/nfsrtt.h>
#include <nfs/nfs_var.h>
/* Global defs. */
extern int nfs_numasync;
-extern int nfsrtton;
extern struct nfsstats nfsstats;
extern int nfsrvw_procrastinate;
extern struct timeval nfsrvw_procrastinate_tv;
@@ -84,7 +82,6 @@ int nfsd_waiting = 0;
#ifdef NFSSERVER
static int nfs_numnfsd = 0;
-static struct nfsdrt nfsdrt;
int (*nfsrv3_procs[NFS_NPROCS])(struct nfsrv_descript *,
struct nfssvc_sock *, struct proc *, struct mbuf **) = {
nfsrv_null,
@@ -127,10 +124,6 @@ struct proc *nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
int nfs_niothreads = -1;
#endif
-#ifdef NFSSERVER
-static void nfsd_rt(int, struct nfsrv_descript *, int);
-#endif
-
/*
* NFS server pseudo system call for the nfsd's
* Based on the flag value it either:
@@ -400,7 +393,6 @@ nfssvc_nfsd(nsd, argp, p)
else
solockp = (int *)0;
if (nd) {
- getmicrotime(&nd->nd_starttime);
if (nd->nd_nam2)
nd->nd_nam = nd->nd_nam2;
else
@@ -473,8 +465,6 @@ nfssvc_nfsd(nsd, argp, p)
error = EPIPE;
m_freem(m);
}
- if (nfsrtton)
- nfsd_rt(sotype, nd, cacherep);
if (nd->nd_nam2)
m_freem(nd->nd_nam2);
if (nd->nd_mrep)
@@ -491,8 +481,6 @@ nfssvc_nfsd(nsd, argp, p)
}
break;
case RC_DROPIT:
- if (nfsrtton)
- nfsd_rt(sotype, nd, cacherep);
m_freem(nd->nd_mrep);
m_freem(nd->nd_nam2);
break;
@@ -633,40 +621,6 @@ nfsrv_init(terminating)
M_WAITOK|M_ZERO);
TAILQ_INSERT_HEAD(&nfssvc_sockhead, nfs_udpsock, ns_chain);
}
-
-/*
- * Add entries to the server monitor log.
- */
-static void
-nfsd_rt(sotype, nd, cacherep)
- int sotype;
- struct nfsrv_descript *nd;
- int cacherep;
-{
- struct drt *rt;
-
- rt = &nfsdrt.drt[nfsdrt.pos];
- if (cacherep == RC_DOIT)
- rt->flag = 0;
- else if (cacherep == RC_REPLY)
- rt->flag = DRT_CACHEREPLY;
- else
- rt->flag = DRT_CACHEDROP;
- if (sotype == SOCK_STREAM)
- rt->flag |= DRT_TCP;
- else if (nd->nd_flag & ND_NFSV3)
- rt->flag |= DRT_NFSV3;
- rt->proc = nd->nd_procnum;
- if (mtod(nd->nd_nam, struct sockaddr *)->sa_family == AF_INET)
- rt->ipadr = mtod(nd->nd_nam, struct sockaddr_in *)->sin_addr.s_addr;
- else
- rt->ipadr = INADDR_ANY;
- getmicrotime(&rt->tstamp);
- rt->resptime =
- ((rt->tstamp.tv_sec - nd->nd_starttime.tv_sec) * 1000000) +
- (rt->tstamp.tv_usec - nd->nd_starttime.tv_usec);
- nfsdrt.pos = (nfsdrt.pos + 1) % NFSRTTLOGSIZ;
-}
#endif /* NFSSERVER */
#ifdef NFSCLIENT
diff --git a/sys/nfs/nfsrtt.h b/sys/nfs/nfsrtt.h
deleted file mode 100644
index 594bc247a64..00000000000
--- a/sys/nfs/nfsrtt.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* $OpenBSD: nfsrtt.h,v 1.6 2003/06/02 23:28:20 millert Exp $ */
-/* $NetBSD: nfsrtt.h,v 1.4 1996/02/18 11:54:07 fvdl Exp $ */
-
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Rick Macklem at The University of Guelph.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)nfsrtt.h 8.2 (Berkeley) 3/30/95
- */
-
-
-#ifndef _NFS_NFSRTT_H_
-#define _NFS_NFSRTT_H_
-
-/*
- * Definitions for performance monitor.
- * The client and server logging are turned on by setting the global
- * constant "nfsrtton" to 1.
- */
-#define NFSRTTLOGSIZ 128
-
-/*
- * Circular log of client side rpc activity. Each log entry is for one
- * rpc filled in upon completion. (ie. in order of completion)
- * The "pos" is the table index for the "next" entry, therefore the
- * list goes from nfsrtt.rttl[pos] --> nfsrtt.rttl[pos - 1] in
- * chronological order of completion.
- */
-struct nfsrtt {
- int pos; /* Position in array for next entry */
- struct rttl {
- int proc; /* NFS procedure number */
- int rtt; /* Measured round trip time */
- int rto; /* Round Trip Timeout */
- int sent; /* # rpcs in progress */
- int cwnd; /* Send window */
- int srtt; /* Ave Round Trip Time */
- int sdrtt; /* Ave mean deviation of RTT */
- fsid_t fsid; /* Fsid for mount point */
- struct timeval tstamp; /* Timestamp of log entry */
- } rttl[NFSRTTLOGSIZ];
-};
-
-/*
- * And definitions for server side performance monitor.
- * The log organization is the same as above except it is filled in at the
- * time the server sends the rpc reply.
- */
-
-/*
- * Bits for the flags field.
- */
-#define DRT_TCP 0x02 /* Client used TCP transport */
-#define DRT_CACHEREPLY 0x04 /* Reply was from recent request cache */
-#define DRT_CACHEDROP 0x08 /* Rpc request dropped, due to recent reply */
-#define DRT_NFSV3 0x10 /* Rpc used NFS Version 3 */
-
-/*
- * Server log structure
- * NB: ipadr == INADDR_ANY indicates a client using a non IP protocol.
- * (ISO perhaps?)
- */
-struct nfsdrt {
- int pos; /* Position of next log entry */
- struct drt {
- int flag; /* Bits as defined above */
- int proc; /* NFS procedure number */
- u_int32_t ipadr; /* IP address of client */
- int resptime; /* Response time (usec) */
- struct timeval tstamp; /* Timestamp of log entry */
- } drt[NFSRTTLOGSIZ];
-};
-
-#endif