summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2008-08-08 20:40:25 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2008-08-08 20:40:25 +0000
commitc5849f13e6a34f2ea4a11b5b172e0b0a40e4090f (patch)
tree561e6cf628104593839ae1590e843d0722c9ced4
parentb0ddeb17473c01bdb50e1393cb1eeeb14105a798 (diff)
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@
-rw-r--r--sys/nfs/nfs_node.c11
-rw-r--r--sys/nfs/nfs_vnops.c8
2 files changed, 4 insertions, 15 deletions
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);