summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorblambert <blambert@openbsd.org>2009-07-20 11:47:58 +0000
committerblambert <blambert@openbsd.org>2009-07-20 11:47:58 +0000
commitff937d6d86049d16b192a24ffb5eb65fbc50bf61 (patch)
tree112fa67094b3421044199e5cc915065d9190eefd /sys/nfs/nfs_socket.c
parentNew options, window-status-current-{fg,bg,attr}, to set the fg, bg and (diff)
downloadwireguard-openbsd-ff937d6d86049d16b192a24ffb5eb65fbc50bf61.tar.xz
wireguard-openbsd-ff937d6d86049d16b192a24ffb5eb65fbc50bf61.zip
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;