From 6d06da81011cebd1efc4dae1d6d0ed94af6f9f76 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 24 May 1998 14:41:56 +0000 Subject: 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. --- sys/nfs/nfs_vfsops.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sys/nfs/nfs_vfsops.c') 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 @@ -52,6 +52,7 @@ #include #include +#include #include #include @@ -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); } -- cgit v1.1