* This code is derived from software contributed to Berkeley by
* Rick Macklem at The University of Guelph.
*
- * %sccs.include.redist.c%
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. 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.
*
- * @(#)nfs_syscalls.c 8.3 (Berkeley) %G%
+ * 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.
+ *
+ * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94
*/
#include <sys/param.h>
static struct nfssvc_sock nfssvc_sockhead;
-#define SLP_DEREFFREE 0x100
-#define SLP_CLRFREE 0x200
-
/*
* Nfs server psuedo system call for the nfsd's
* Based on the flag value it either:
else {
slp = (struct nfssvc_sock *)
malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK);
- printf("Alloc nfssvc_sock 0x%x\n", slp);
bzero((caddr_t)slp, sizeof (struct nfssvc_sock));
slp->ns_prev = nfssvc_sockhead.ns_prev;
slp->ns_prev->ns_next = slp;
nd->nd_slp = (struct nfssvc_sock *)0;
nfsrv_slpderef(slp);
}
-#ifdef DIAGNOSTIC
- if (p->p_spare[0])
- panic("nfssvc: M_NAMEI");
- if (p->p_spare[1])
- panic("nfssvc: STARTSAVE");
-#endif
}
done:
remque(nd);
register struct nfssvc_sock *slp;
{
if (--(slp->ns_sref) == 0 && (slp->ns_flag & SLP_VALID) == 0) {
-#ifdef NOTYET
slp->ns_prev->ns_next = slp->ns_next;
slp->ns_next->ns_prev = slp->ns_prev;
free((caddr_t)slp, M_NFSSVC);
-#else
- if (slp->ns_flag & SLP_DEREFFREE)
- panic("deref dup free 0x%x of deref free\n", slp);
- else {
- slp->ns_prev->ns_next = slp->ns_next;
- slp->ns_next->ns_prev = slp->ns_prev;
- }
- if (slp->ns_flag & SLP_CLRFREE)
- panic("deref dup free 0x%x of clrall free\n", slp);
- slp->ns_flag |= SLP_DEREFFREE;
- printf("Free deref sock 0x%x\n", slp);
-#endif
}
}
slp->ns_prev->ns_next = slp->ns_next;
oslp = slp;
slp = slp->ns_next;
-#ifdef NOTYET
free((caddr_t)oslp, M_NFSSVC);
-#else
- if (oslp->ns_flag & SLP_DEREFFREE)
- panic("clrall dup free 0x%x of deref free\n",
- oslp);
- if (oslp->ns_flag & SLP_CLRFREE)
- panic("clrall dup free 0x%x of clrall free\n",
- oslp);
- oslp->ns_flag |= SLP_CLRFREE;
- printf("Free all socks 0x%x\n", oslp);
-#endif
}
nfsrv_cleancache(); /* And clear out server cache */
}
nfs_udpsock = (struct nfssvc_sock *)
malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK);
- printf("Alloc nfs_udpsock 0x%x\n", nfs_udpsock);
bzero((caddr_t)nfs_udpsock, sizeof (struct nfssvc_sock));
nfs_cltpsock = (struct nfssvc_sock *)
malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK);
- printf("Alloc nfs_cltpsock 0x%x\n", nfs_cltpsock);
bzero((caddr_t)nfs_cltpsock, sizeof (struct nfssvc_sock));
nfssvc_sockhead.ns_next = nfs_udpsock;
nfs_udpsock->ns_next = nfs_cltpsock;