diff options
author | dyson <dyson@FreeBSD.org> | 1997-09-21 04:24:27 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-09-21 04:24:27 +0000 |
commit | e64b1984f97c6d987d7d36b61a3afe5028a08312 (patch) | |
tree | 325bcf17de3aad0383fb86548872026a7c3d2599 /sys/nfsclient | |
parent | 1419fcb42b4e1e5a73f4574739f4c232fde357e2 (diff) | |
download | FreeBSD-src-e64b1984f97c6d987d7d36b61a3afe5028a08312.zip FreeBSD-src-e64b1984f97c6d987d7d36b61a3afe5028a08312.tar.gz |
Change the M_NAMEI allocations to use the zone allocator. This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half. The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs. Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_node.c | 4 | ||||
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 21 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 16 |
3 files changed, 21 insertions, 20 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 66796aa..fe9ae21 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.17 1997/05/09 13:04:43 dfr Exp $ + * $Id: nfs_node.c,v 1.18 1997/08/02 14:33:07 bde Exp $ */ @@ -373,6 +373,6 @@ nfs_abortop(ap) { if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) - FREE(ap->a_cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, ap->a_cnp->cn_pnbuf); return (0); } diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index e7b5340..4367794 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.41 1997/08/16 19:15:59 wollman Exp $ + * $Id: nfs_subs.c,v 1.42 1997/09/10 19:52:26 phk Exp $ */ /* @@ -1444,7 +1444,8 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) struct componentname *cnp = &ndp->ni_cnd; *retdirp = (struct vnode *)0; - MALLOC(cnp->cn_pnbuf, char *, len + 1, M_NAMEI, M_WAITOK); + cnp->cn_pnbuf = zalloc(namei_zone); + /* * Copy the name from the mbuf list to ndp->ni_pnbuf * and set the various ndp fields appropriately. @@ -1506,7 +1507,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) * Oh joy. For WebNFS, handle those pesky '%' escapes, * and the 'native path' indicator. */ - MALLOC(cp, char *, MAXPATHLEN, M_NAMEI, M_WAITOK); + cp = zalloc(namei_zone); fromcp = cnp->cn_pnbuf; tocp = cp; if ((unsigned char)*fromcp >= WEBNFS_SPECCHAR_START) { @@ -1524,7 +1525,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) */ default: error = EIO; - FREE(cp, M_NAMEI); + zfree(namei_zone, cp); goto out; } } @@ -1540,14 +1541,14 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) continue; } else { error = ENOENT; - FREE(cp, M_NAMEI); + zfree(namei_zone, cp); goto out; } } else *tocp++ = *fromcp++; } *tocp = '\0'; - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); cnp->cn_pnbuf = cp; } @@ -1601,7 +1602,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) break; } if (ndp->ni_pathlen > 1) - MALLOC(cp, char *, MAXPATHLEN, M_NAMEI, M_WAITOK); + cp = zalloc(namei_zone); else cp = cnp->cn_pnbuf; aiov.iov_base = cp; @@ -1617,7 +1618,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) if (error) { badlink: if (ndp->ni_pathlen > 1) - FREE(cp, M_NAMEI); + zfree(namei_zone, cp); break; } linklen = MAXPATHLEN - auio.uio_resid; @@ -1631,7 +1632,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) } if (ndp->ni_pathlen > 1) { bcopy(ndp->ni_next, cp + linklen, ndp->ni_pathlen); - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); cnp->cn_pnbuf = cp; } else cnp->cn_pnbuf[linklen] = '\0'; @@ -1649,7 +1650,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p, kerbflag, pubflag) } } out: - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); return (error); } diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 87b1823..278e4f3 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.59 1997/09/10 21:27:40 phk Exp $ + * $Id: nfs_vnops.c,v 1.60 1997/09/14 03:00:44 peter Exp $ */ @@ -1302,7 +1302,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap) cache_enter(dvp, newvp, cnp); *vpp = newvp; } - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; @@ -1437,7 +1437,7 @@ again: cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; @@ -1508,7 +1508,7 @@ nfs_remove(ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); np->n_attrstamp = 0; vput(dvp); if (vp == dvp) @@ -1743,7 +1743,7 @@ nfs_link(ap) nfsm_wcc_data(tdvp, wccflag); } nfsm_reqdone; - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); VTONFS(tdvp)->n_flag |= NMODIFIED; if (!attrflag) VTONFS(vp)->n_attrstamp = 0; @@ -1815,7 +1815,7 @@ nfs_symlink(ap) nfsm_reqdone; if (newvp) vput(newvp); - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; @@ -1912,7 +1912,7 @@ nfs_mkdir(ap) vrele(newvp); } else *ap->a_vpp = newvp; - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); vput(dvp); return (error); } @@ -1948,7 +1948,7 @@ nfs_rmdir(ap) if (v3) nfsm_wcc_data(dvp, wccflag); nfsm_reqdone; - FREE(cnp->cn_pnbuf, M_NAMEI); + zfree(namei_zone, cnp->cn_pnbuf); VTONFS(dvp)->n_flag |= NMODIFIED; if (!wccflag) VTONFS(dvp)->n_attrstamp = 0; |