diff options
author | jhb <jhb@FreeBSD.org> | 2004-02-06 19:35:14 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-02-06 19:35:14 +0000 |
commit | ad9ddd0d33ec42266c697b1f837ec40bdf091dbb (patch) | |
tree | f181dfe96828361676818e51365d0fe470dab7b7 /sys/kern/kern_resource.c | |
parent | 3618d8780be5bf99ec7e1accf26926fb3dc1bf9e (diff) | |
download | FreeBSD-src-ad9ddd0d33ec42266c697b1f837ec40bdf091dbb.zip FreeBSD-src-ad9ddd0d33ec42266c697b1f837ec40bdf091dbb.tar.gz |
- Convert the plimit lock to a pool mutex lock.
- Hide struct plimit from userland.
Submitted by: bde (2)
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r-- | sys/kern/kern_resource.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 3608401..e995d1c 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -837,9 +837,9 @@ lim_alloc() struct plimit *limp; limp = (struct plimit *)malloc(sizeof(struct plimit), M_PLIMIT, - M_WAITOK | M_ZERO); + M_WAITOK); limp->pl_refcnt = 1; - mtx_init(&limp->pl_mtx, "plimit lock", NULL, MTX_DEF); + limp->pl_mtx = mtx_pool_alloc(mtxpool_sleep); return (limp); } @@ -862,7 +862,7 @@ lim_free(limp) LIM_LOCK(limp); KASSERT(limp->pl_refcnt > 0, ("plimit refcnt underflow")); if (--limp->pl_refcnt == 0) { - mtx_destroy(&limp->pl_mtx); + LIM_UNLOCK(limp); free((void *)limp, M_PLIMIT); return; } |