From: blambert Date: Fri, 8 Aug 2008 20:40:24 +0000 (+0000) Subject: Remove code for variable-sized allocations of NFS filehandles by malloc(), X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=286bada861388c52c794652badd0655f1e3f90b9;p=openbsd Remove code for variable-sized allocations of NFS filehandles by malloc(), as it was never used because there were 64-bit buffers already allocated for filehandles in nfsnode structs. ok thib@ --- diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 94e87cfe8f5..c596139a32f 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.40 2008/06/14 10:55:21 mk Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.41 2008/08/08 20:40:24 blambert Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -144,10 +144,7 @@ loop: } LIST_INSERT_HEAD(nhpp, np, n_hash); - if (fhsize > NFS_SMALLFH) { - np->n_fhp = malloc(fhsize, M_NFSBIGFH, M_WAITOK); - } else - np->n_fhp = &np->n_fh; + np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; np->n_accstamp = -1; @@ -212,9 +209,6 @@ nfs_reclaim(v) if (np->n_hash.le_prev != NULL) LIST_REMOVE(np, n_hash); - if (np->n_fhsize > NFS_SMALLFH) - free(np->n_fhp, M_NFSBIGFH); - if (np->n_rcred) crfree(np->n_rcred); if (np->n_wcred) @@ -224,4 +218,3 @@ nfs_reclaim(v) vp->v_data = NULL; return (0); } - diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index bd8471bbc5f..de940501b75 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.98 2008/07/25 14:56:47 beck Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.99 2008/08/08 20:40:24 blambert Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -2512,11 +2512,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp) nfsm_getfh(nfhp, fhlen, v3); if (*npp) { np = *npp; - if (np->n_fhsize > NFS_SMALLFH && fhlen <= NFS_SMALLFH) { - free((caddr_t)np->n_fhp, M_NFSBIGFH); - np->n_fhp = &np->n_fh; - } else if (np->n_fhsize <= NFS_SMALLFH && fhlen>NFS_SMALLFH) - np->n_fhp =(nfsfh_t *)malloc(fhlen,M_NFSBIGFH,M_WAITOK); + np->n_fhp = &np->n_fh; bcopy((caddr_t)nfhp, (caddr_t)np->n_fhp, fhlen); np->n_fhsize = fhlen; newvp = NFSTOV(np);