summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-06-14 11:13:21 +0000
committerphk <phk@FreeBSD.org>1996-06-14 11:13:21 +0000
commitea659e907a04a78bd9177cf580b96c30fd471db3 (patch)
tree5ced02520e76d56e1eb1c52376ef25a03b02891b /sys/nfsserver
parentde013e282df86ab6d2bfe323425f4bf6f00220f9 (diff)
downloadFreeBSD-src-ea659e907a04a78bd9177cf580b96c30fd471db3.zip
FreeBSD-src-ea659e907a04a78bd9177cf580b96c30fd471db3.tar.gz
Fix for NFS_NOSERVER
Poul mentioned that he thought this was some kind of timing problem, and that started me thinking. After a little poking around, I found that nfs_timer() was completely disabled when NFS_NOSERVER was #defined. But after looking at nfs_timer(), it seemed like it was something required by both the client and server code, and disabling it outright just didn't seem to make any sense. Parts of it relate only to the NFS server side code, so I disabled those, but I re-enabled the rest of the function and made sure that it would be called from nfs_init() (in nfs_subs.c). With nfs_timer() re-enabled, everything seems to work again. The only other changes I made were to #ifdef away some variable declarations in the NFS_NOSERVER case so that gcc would stop complaining about unused variables. Reviewed by: phk Submitted by: Bill Paul <wpaul@skynet.ctr.columbia.edu>
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_srvsock.c15
-rw-r--r--sys/nfsserver/nfs_srvsubs.c6
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 0f9c8c1..d372b92 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94
- * $Id: nfs_socket.c,v 1.14 1996/01/13 23:27:52 phk Exp $
+ * $Id: nfs_socket.c,v 1.15 1996/02/13 18:16:28 wollman Exp $
*/
/*
@@ -141,9 +141,9 @@ static void nfs_realign __P((struct mbuf *m, int hsiz));
static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname,
struct mbuf **mp));
static int nfs_reconnect __P((struct nfsreq *rep));
+#ifndef NFS_NOSERVER
static int nfsrv_getstream __P((struct nfssvc_sock *,int));
-#ifndef NFS_NOSERVER
int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd,
struct nfssvc_sock *slp,
struct proc *procp,
@@ -1267,6 +1267,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp)
}
+#endif /* NFS_NOSERVER */
/*
* Nfs timer routine
* Scan the nfsreq list and retranmit any requests that have timed out
@@ -1282,10 +1283,12 @@ nfs_timer(arg)
register struct socket *so;
register struct nfsmount *nmp;
register int timeo;
- register struct nfssvc_sock *slp;
- static long lasttime = 0;
int s, error;
+#ifndef NFS_NOSERVER
+ static long lasttime = 0;
+ register struct nfssvc_sock *slp;
u_quad_t cur_usec;
+#endif /* NFS_NOSERVER */
s = splnet();
for (rep = nfs_reqq.tqh_first; rep != 0; rep = rep->r_chain.tqe_next) {
@@ -1374,7 +1377,7 @@ nfs_timer(arg)
}
}
}
-
+#ifndef NFS_NOSERVER
/*
* Call the nqnfs server timer once a second to handle leases.
*/
@@ -1393,11 +1396,11 @@ nfs_timer(arg)
if (slp->ns_tq.lh_first && slp->ns_tq.lh_first->nd_time<=cur_usec)
nfsrv_wakenfsd(slp);
}
+#endif /* NFS_NOSERVER */
splx(s);
timeout(nfs_timer, (void *)0, nfs_ticks);
}
-#endif /* NFS_NOSERVER */
/*
* Test for a termination condition pending on the process.
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index f0c670c..9f5215f 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.27 1996/01/13 23:27:56 phk Exp $
+ * $Id: nfs_subs.c,v 1.28 1996/01/19 03:58:52 dyson Exp $
*/
/*
@@ -1147,9 +1147,9 @@ nfs_init()
* Initialize reply list and start timer
*/
TAILQ_INIT(&nfs_reqq);
-#ifndef NFS_NOSERVER
+
nfs_timer(0);
-#endif
+
#ifdef __FreeBSD__
/*
OpenPOWER on IntegriCloud