summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-05-24 14:41:56 +0000
committerpeter <peter@FreeBSD.org>1998-05-24 14:41:56 +0000
commit6d06da81011cebd1efc4dae1d6d0ed94af6f9f76 (patch)
treea7d0873d8bee7b3560ff38fa06bed1c742b6c0a1 /sys
parentc9dd9f41486532c8fa517b5d63ccc208e00fb8cd (diff)
downloadFreeBSD-src-6d06da81011cebd1efc4dae1d6d0ed94af6f9f76.zip
FreeBSD-src-6d06da81011cebd1efc4dae1d6d0ed94af6f9f76.tar.gz
Convert a couple of large allocations to use zones rather than malloc
for better packing. This means that we can choose better values for the various hash entries without having to try and get it all to fit within an artificial power of two limit for malloc's sake.
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs.h10
-rw-r--r--sys/nfs/nfs_common.c12
-rw-r--r--sys/nfs/nfs_node.c23
-rw-r--r--sys/nfs/nfs_nqlease.c6
-rw-r--r--sys/nfs/nfs_subs.c12
-rw-r--r--sys/nfs/nfs_vfsops.c14
-rw-r--r--sys/nfsclient/nfs.h10
-rw-r--r--sys/nfsclient/nfs_node.c23
-rw-r--r--sys/nfsclient/nfs_subs.c12
-rw-r--r--sys/nfsclient/nfs_vfsops.c14
-rw-r--r--sys/nfsclient/nfsargs.h10
-rw-r--r--sys/nfsclient/nfsstats.h10
-rw-r--r--sys/nfsserver/nfs.h10
-rw-r--r--sys/nfsserver/nfs_srvsubs.c12
-rw-r--r--sys/nfsserver/nfsrvstats.h10
15 files changed, 86 insertions, 102 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h
index ad606ad..20093f6 100644
--- a/sys/nfs/nfs.h
+++ b/sys/nfs/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index b81eedf..93fca3c 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.53 1998/04/06 11:41:07 phk Exp $
+ * $Id: nfs_subs.c,v 1.54 1998/05/19 07:11:24 peter Exp $
*/
/*
@@ -1099,17 +1099,11 @@ nfs_init(vfsp)
{
register int i;
+ nfsmount_zone = zinit("NFSMOUNT", sizeof(struct nfsmount), 0, 0, 1);
+
/*
* Check to see if major data structures haven't bloated.
*/
- if (sizeof (struct nfsnode) > NFS_NODEALLOC) {
- printf("struct nfsnode bloated (> %dbytes)\n", NFS_NODEALLOC);
- printf("Try reducing NFS_SMALLFH\n");
- }
- if (sizeof (struct nfsmount) > NFS_MNTALLOC) {
- printf("struct nfsmount bloated (> %dbytes)\n", NFS_MNTALLOC);
- printf("Try reducing NFS_MUIDHASHSIZ\n");
- }
if (sizeof (struct nfssvc_sock) > NFS_SVCALLOC) {
printf("struct nfssvc_sock bloated (> %dbytes)\n",NFS_SVCALLOC);
printf("Try reducing NFS_UIDHASHSIZ\n");
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c
index 364e78a..dc67b36 100644
--- a/sys/nfs/nfs_node.c
+++ b/sys/nfs/nfs_node.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_node.c 8.6 (Berkeley) 5/22/95
- * $Id: nfs_node.c,v 1.25 1998/05/13 06:10:13 peter Exp $
+ * $Id: nfs_node.c,v 1.26 1998/05/13 07:49:08 peter Exp $
*/
@@ -54,8 +54,7 @@
#include <nfs/nfsnode.h>
#include <nfs/nfsmount.h>
-static MALLOC_DEFINE(M_NFSNODE, "NFS node", "NFS vnode private part");
-
+static vm_zone_t nfsnode_zone;
static LIST_HEAD(nfsnodehashhead, nfsnode) *nfsnodehashtbl;
static u_long nfsnodehash;
@@ -69,12 +68,8 @@ static u_long nfsnodehash;
void
nfs_nhinit()
{
-
-#ifndef lint
- if ((sizeof(struct nfsnode) - 1) & sizeof(struct nfsnode))
- printf("nfs_nhinit: bad size %d\n", sizeof(struct nfsnode));
-#endif /* not lint */
- nfsnodehashtbl = hashinit(desiredvnodes, M_NFSNODE, &nfsnodehash);
+ nfsnode_zone = zinit("NFSNODE", sizeof(struct nfsnode), 0, 0, 1);
+ nfsnodehashtbl = hashinit(desiredvnodes, M_NFSHASH, &nfsnodehash);
}
/*
@@ -144,11 +139,11 @@ loop:
nfs_node_hash_lock = 1;
/*
- * Do the MALLOC before the getnewvnode since doing so afterward
+ * Allocate before getnewvnode since doing so afterward
* might cause a bogus v_data pointer to get dereferenced
- * elsewhere if MALLOC should block.
+ * elsewhere if zalloc should block.
*/
- MALLOC(np, struct nfsnode *, sizeof *np, M_NFSNODE, M_WAITOK);
+ np = zalloc(nfsnode_zone);
error = getnewvnode(VT_NFS, mntp, nfsv2_vnodeop_p, &nvp);
if (error) {
@@ -156,7 +151,7 @@ loop:
wakeup(&nfs_node_hash_lock);
nfs_node_hash_lock = 0;
*npp = 0;
- FREE(np, M_NFSNODE);
+ zfree(nfsnode_zone, np);
return (error);
}
vp = nvp;
@@ -274,7 +269,7 @@ nfs_reclaim(ap)
}
cache_purge(vp);
- FREE(vp->v_data, M_NFSNODE);
+ zfree(nfsnode_zone, vp->v_data);
vp->v_data = (void *)0;
return (0);
}
diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c
index 2858da5..5281988 100644
--- a/sys/nfs/nfs_nqlease.c
+++ b/sys/nfs/nfs_nqlease.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95
- * $Id: nfs_nqlease.c,v 1.33 1998/03/30 09:53:48 phk Exp $
+ * $Id: nfs_nqlease.c,v 1.34 1998/05/19 07:11:23 peter Exp $
*/
@@ -63,6 +63,8 @@
#include <sys/socketvar.h>
#include <sys/protosw.h>
+#include <vm/vm_zone.h>
+
#include <netinet/in.h>
#include <nfs/rpcv2.h>
#include <nfs/nfsproto.h>
@@ -1166,7 +1168,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p)
TAILQ_REMOVE(&nmp->nm_uidlruhead, nuidp, nu_lru);
free((caddr_t)nuidp, M_NFSUID);
}
- free((caddr_t)nmp, M_NFSMNT);
+ zfree(nfsmount_zone, nmp);
if (error == EWOULDBLOCK)
error = 0;
return (error);
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index b81eedf..93fca3c 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.53 1998/04/06 11:41:07 phk Exp $
+ * $Id: nfs_subs.c,v 1.54 1998/05/19 07:11:24 peter Exp $
*/
/*
@@ -1099,17 +1099,11 @@ nfs_init(vfsp)
{
register int i;
+ nfsmount_zone = zinit("NFSMOUNT", sizeof(struct nfsmount), 0, 0, 1);
+
/*
* Check to see if major data structures haven't bloated.
*/
- if (sizeof (struct nfsnode) > NFS_NODEALLOC) {
- printf("struct nfsnode bloated (> %dbytes)\n", NFS_NODEALLOC);
- printf("Try reducing NFS_SMALLFH\n");
- }
- if (sizeof (struct nfsmount) > NFS_MNTALLOC) {
- printf("struct nfsmount bloated (> %dbytes)\n", NFS_MNTALLOC);
- printf("Try reducing NFS_MUIDHASHSIZ\n");
- }
if (sizeof (struct nfssvc_sock) > NFS_SVCALLOC) {
printf("struct nfssvc_sock bloated (> %dbytes)\n",NFS_SVCALLOC);
printf("Try reducing NFS_UIDHASHSIZ\n");
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index afa850f..729ccba 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.61 1998/05/20 08:02:24 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.62 1998/05/20 08:05:45 peter Exp $
*/
#include <sys/param.h>
@@ -52,6 +52,7 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <vm/vm_zone.h>
#include <net/if.h>
#include <net/route.h>
@@ -72,13 +73,15 @@ extern int nfs_mountroot __P((struct mount *mp));
extern int nfs_ticks;
MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header");
-MALLOC_DEFINE(M_NFSMNT, "NFS mount", "NFS mount structure");
MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle");
MALLOC_DEFINE(M_NFSD, "NFS daemon", "Nfs server daemon structure");
MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data");
MALLOC_DEFINE(M_NFSRVDESC, "NFSV3 srvdesc", "NFS server socket descriptor");
MALLOC_DEFINE(M_NFSUID, "NFS uid", "Nfs uid mapping structure");
MALLOC_DEFINE(M_NQLEASE, "NQNFS Lease", "Nqnfs lease");
+MALLOC_DEFINE(M_NFSHASH, "NFS hash", "NFS hash tables");
+
+vm_zone_t nfsmount_zone;
struct nfsstats nfsstats;
SYSCTL_NODE(_vfs, MOUNT_NFS, nfs, CTLFLAG_RW, 0, "NFS filesystem");
@@ -670,8 +673,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
FREE(nam, M_SONAME);
return (0);
} else {
- MALLOC(nmp, struct nfsmount *, sizeof (struct nfsmount),
- M_NFSMNT, M_WAITOK);
+ nmp = zalloc(nfsmount_zone);
bzero((caddr_t)nmp, sizeof (struct nfsmount));
TAILQ_INIT(&nmp->nm_uidlruhead);
TAILQ_INIT(&nmp->nm_bufq);
@@ -849,7 +851,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
return (0);
bad:
nfs_disconnect(nmp);
- free((caddr_t)nmp, M_NFSMNT);
+ zfree(nfsmount_zone, nmp);
FREE(nam, M_SONAME);
return (error);
}
@@ -924,7 +926,7 @@ nfs_unmount(mp, mntflags, p)
FREE(nmp->nm_nam, M_SONAME);
if ((nmp->nm_flag & (NFSMNT_NQNFS | NFSMNT_KERB)) == 0)
- free((caddr_t)nmp, M_NFSMNT);
+ zfree(nfsmount_zone, nmp);
return (0);
}
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h
index ad606ad..20093f6 100644
--- a/sys/nfsclient/nfs.h
+++ b/sys/nfsclient/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index 364e78a..dc67b36 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_node.c 8.6 (Berkeley) 5/22/95
- * $Id: nfs_node.c,v 1.25 1998/05/13 06:10:13 peter Exp $
+ * $Id: nfs_node.c,v 1.26 1998/05/13 07:49:08 peter Exp $
*/
@@ -54,8 +54,7 @@
#include <nfs/nfsnode.h>
#include <nfs/nfsmount.h>
-static MALLOC_DEFINE(M_NFSNODE, "NFS node", "NFS vnode private part");
-
+static vm_zone_t nfsnode_zone;
static LIST_HEAD(nfsnodehashhead, nfsnode) *nfsnodehashtbl;
static u_long nfsnodehash;
@@ -69,12 +68,8 @@ static u_long nfsnodehash;
void
nfs_nhinit()
{
-
-#ifndef lint
- if ((sizeof(struct nfsnode) - 1) & sizeof(struct nfsnode))
- printf("nfs_nhinit: bad size %d\n", sizeof(struct nfsnode));
-#endif /* not lint */
- nfsnodehashtbl = hashinit(desiredvnodes, M_NFSNODE, &nfsnodehash);
+ nfsnode_zone = zinit("NFSNODE", sizeof(struct nfsnode), 0, 0, 1);
+ nfsnodehashtbl = hashinit(desiredvnodes, M_NFSHASH, &nfsnodehash);
}
/*
@@ -144,11 +139,11 @@ loop:
nfs_node_hash_lock = 1;
/*
- * Do the MALLOC before the getnewvnode since doing so afterward
+ * Allocate before getnewvnode since doing so afterward
* might cause a bogus v_data pointer to get dereferenced
- * elsewhere if MALLOC should block.
+ * elsewhere if zalloc should block.
*/
- MALLOC(np, struct nfsnode *, sizeof *np, M_NFSNODE, M_WAITOK);
+ np = zalloc(nfsnode_zone);
error = getnewvnode(VT_NFS, mntp, nfsv2_vnodeop_p, &nvp);
if (error) {
@@ -156,7 +151,7 @@ loop:
wakeup(&nfs_node_hash_lock);
nfs_node_hash_lock = 0;
*npp = 0;
- FREE(np, M_NFSNODE);
+ zfree(nfsnode_zone, np);
return (error);
}
vp = nvp;
@@ -274,7 +269,7 @@ nfs_reclaim(ap)
}
cache_purge(vp);
- FREE(vp->v_data, M_NFSNODE);
+ zfree(nfsnode_zone, vp->v_data);
vp->v_data = (void *)0;
return (0);
}
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index b81eedf..93fca3c 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_subs.c,v 1.53 1998/04/06 11:41:07 phk Exp $
+ * $Id: nfs_subs.c,v 1.54 1998/05/19 07:11:24 peter Exp $
*/
/*
@@ -1099,17 +1099,11 @@ nfs_init(vfsp)
{
register int i;
+ nfsmount_zone = zinit("NFSMOUNT", sizeof(struct nfsmount), 0, 0, 1);
+
/*
* Check to see if major data structures haven't bloated.
*/
- if (sizeof (struct nfsnode) > NFS_NODEALLOC) {
- printf("struct nfsnode bloated (> %dbytes)\n", NFS_NODEALLOC);
- printf("Try reducing NFS_SMALLFH\n");
- }
- if (sizeof (struct nfsmount) > NFS_MNTALLOC) {
- printf("struct nfsmount bloated (> %dbytes)\n", NFS_MNTALLOC);
- printf("Try reducing NFS_MUIDHASHSIZ\n");
- }
if (sizeof (struct nfssvc_sock) > NFS_SVCALLOC) {
printf("struct nfssvc_sock bloated (> %dbytes)\n",NFS_SVCALLOC);
printf("Try reducing NFS_UIDHASHSIZ\n");
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index afa850f..729ccba 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
- * $Id: nfs_vfsops.c,v 1.61 1998/05/20 08:02:24 peter Exp $
+ * $Id: nfs_vfsops.c,v 1.62 1998/05/20 08:05:45 peter Exp $
*/
#include <sys/param.h>
@@ -52,6 +52,7 @@
#include <vm/vm.h>
#include <vm/vm_extern.h>
+#include <vm/vm_zone.h>
#include <net/if.h>
#include <net/route.h>
@@ -72,13 +73,15 @@ extern int nfs_mountroot __P((struct mount *mp));
extern int nfs_ticks;
MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header");
-MALLOC_DEFINE(M_NFSMNT, "NFS mount", "NFS mount structure");
MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle");
MALLOC_DEFINE(M_NFSD, "NFS daemon", "Nfs server daemon structure");
MALLOC_DEFINE(M_NFSDIROFF, "NFSV3 diroff", "NFS directory offset data");
MALLOC_DEFINE(M_NFSRVDESC, "NFSV3 srvdesc", "NFS server socket descriptor");
MALLOC_DEFINE(M_NFSUID, "NFS uid", "Nfs uid mapping structure");
MALLOC_DEFINE(M_NQLEASE, "NQNFS Lease", "Nqnfs lease");
+MALLOC_DEFINE(M_NFSHASH, "NFS hash", "NFS hash tables");
+
+vm_zone_t nfsmount_zone;
struct nfsstats nfsstats;
SYSCTL_NODE(_vfs, MOUNT_NFS, nfs, CTLFLAG_RW, 0, "NFS filesystem");
@@ -670,8 +673,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
FREE(nam, M_SONAME);
return (0);
} else {
- MALLOC(nmp, struct nfsmount *, sizeof (struct nfsmount),
- M_NFSMNT, M_WAITOK);
+ nmp = zalloc(nfsmount_zone);
bzero((caddr_t)nmp, sizeof (struct nfsmount));
TAILQ_INIT(&nmp->nm_uidlruhead);
TAILQ_INIT(&nmp->nm_bufq);
@@ -849,7 +851,7 @@ mountnfs(argp, mp, nam, pth, hst, vpp)
return (0);
bad:
nfs_disconnect(nmp);
- free((caddr_t)nmp, M_NFSMNT);
+ zfree(nfsmount_zone, nmp);
FREE(nam, M_SONAME);
return (error);
}
@@ -924,7 +926,7 @@ nfs_unmount(mp, mntflags, p)
FREE(nmp->nm_nam, M_SONAME);
if ((nmp->nm_flag & (NFSMNT_NQNFS | NFSMNT_KERB)) == 0)
- free((caddr_t)nmp, M_NFSMNT);
+ zfree(nfsmount_zone, nmp);
return (0);
}
diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h
index ad606ad..20093f6 100644
--- a/sys/nfsclient/nfsargs.h
+++ b/sys/nfsclient/nfsargs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h
index ad606ad..20093f6 100644
--- a/sys/nfsclient/nfsstats.h
+++ b/sys/nfsclient/nfsstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h
index ad606ad..20093f6 100644
--- a/sys/nfsserver/nfs.h
+++ b/sys/nfsserver/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index b81eedf..93fca3c 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.53 1998/04/06 11:41:07 phk Exp $
+ * $Id: nfs_subs.c,v 1.54 1998/05/19 07:11:24 peter Exp $
*/
/*
@@ -1099,17 +1099,11 @@ nfs_init(vfsp)
{
register int i;
+ nfsmount_zone = zinit("NFSMOUNT", sizeof(struct nfsmount), 0, 0, 1);
+
/*
* Check to see if major data structures haven't bloated.
*/
- if (sizeof (struct nfsnode) > NFS_NODEALLOC) {
- printf("struct nfsnode bloated (> %dbytes)\n", NFS_NODEALLOC);
- printf("Try reducing NFS_SMALLFH\n");
- }
- if (sizeof (struct nfsmount) > NFS_MNTALLOC) {
- printf("struct nfsmount bloated (> %dbytes)\n", NFS_MNTALLOC);
- printf("Try reducing NFS_MUIDHASHSIZ\n");
- }
if (sizeof (struct nfssvc_sock) > NFS_SVCALLOC) {
printf("struct nfssvc_sock bloated (> %dbytes)\n",NFS_SVCALLOC);
printf("Try reducing NFS_UIDHASHSIZ\n");
diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h
index ad606ad..20093f6 100644
--- a/sys/nfsserver/nfsrvstats.h
+++ b/sys/nfsserver/nfsrvstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
- * $Id: nfs.h,v 1.34 1998/03/30 09:53:43 phk Exp $
+ * $Id: nfs.h,v 1.35 1998/05/19 07:11:22 peter Exp $
*/
#ifndef _NFS_NFS_H_
@@ -118,8 +118,6 @@
* to one that does not allocate space in powers of 2 size, then this all
* becomes bunk!)
*/
-#define NFS_NODEALLOC 256
-#define NFS_MNTALLOC 512
#define NFS_SVCALLOC 256
#define NFS_UIDALLOC 128
@@ -307,13 +305,17 @@ union nethostaddr {
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_NFSREQ);
-MALLOC_DECLARE(M_NFSMNT);
MALLOC_DECLARE(M_NFSDIROFF);
MALLOC_DECLARE(M_NFSRVDESC);
MALLOC_DECLARE(M_NFSUID);
MALLOC_DECLARE(M_NQLEASE);
MALLOC_DECLARE(M_NFSD);
MALLOC_DECLARE(M_NFSBIGFH);
+MALLOC_DECLARE(M_NFSHASH);
+#endif
+
+#ifdef ZONE_INTERRUPT
+extern vm_zone_t nfsmount_zone;
#endif
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
OpenPOWER on IntegriCloud