summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2009-07-20 11:47:59 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2009-07-20 11:47:59 +0000
commit299f6ff5b8d74399336260c4373ad068ff38a11e (patch)
treed6ab6933c032d05f9c14ebaceb6f1a8d20086113 /sys/nfs/nfs_socket.c
parent281ace9111ced0f82d23c56782989c9361bbcf1a (diff)
For memory that gets allocated for every NFS request, pools make more
sense than malloc. ok thib@, who says the puffin still gets it either way
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r--sys/nfs/nfs_socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 711df25ea09..06f7850d066 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.88 2009/07/18 20:30:22 thib Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.89 2009/07/20 11:47:58 blambert Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -78,6 +78,8 @@ extern int nfs_ticks;
struct nfsreqhead nfs_reqq;
+extern struct pool nfsrv_descript_pl;
+
/*
* There is a congestion window for outstanding rpcs maintained per mount
* point. The cwnd size is adjusted in roughly the way that:
@@ -1881,7 +1883,7 @@ nfsrv_dorec(slp, nfsd, ndp)
nam->m_next = NULL;
} else
nam = NULL;
- nd = malloc(sizeof(struct nfsrv_descript), M_NFSRVDESC, M_WAITOK);
+ nd = pool_get(&nfsrv_descript_pl, PR_WAITOK);
nfs_realign(&m, 10 * NFSX_UNSIGNED);
nd->nd_md = nd->nd_mrep = m;
nd->nd_nam2 = nam;
@@ -1889,7 +1891,7 @@ nfsrv_dorec(slp, nfsd, ndp)
error = nfs_getreq(nd, nfsd, 1);
if (error) {
m_freem(nam);
- free(nd, M_NFSRVDESC);
+ pool_put(&nfsrv_descript_pl, nd);
return (error);
}
*ndp = nd;