summaryrefslogtreecommitdiffstats
path: root/sys/sys/resourcevar.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-02-06 19:35:14 +0000
committerjhb <jhb@FreeBSD.org>2004-02-06 19:35:14 +0000
commitad9ddd0d33ec42266c697b1f837ec40bdf091dbb (patch)
treef181dfe96828361676818e51365d0fe470dab7b7 /sys/sys/resourcevar.h
parent3618d8780be5bf99ec7e1accf26926fb3dc1bf9e (diff)
downloadFreeBSD-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/sys/resourcevar.h')
-rw-r--r--sys/sys/resourcevar.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h
index 1b50f09..2847ec8 100644
--- a/sys/sys/resourcevar.h
+++ b/sys/sys/resourcevar.h
@@ -68,6 +68,8 @@ struct pstats {
struct timeval p_start; /* starting time */
};
+#ifdef _KERNEL
+
/*
* Kernel shareable process resource limits. Because this structure
* is moderately large but changes infrequently, it is normally
@@ -76,20 +78,12 @@ struct pstats {
struct plimit {
struct rlimit pl_rlimit[RLIM_NLIMITS];
int pl_refcnt; /* number of references */
- struct mtx pl_mtx;
+ struct mtx *pl_mtx;
};
-#ifdef _KERNEL
-
-/*
- * Lock order for operations involving the plimit lock:
- * filedesc <important to avoid deadlocks in the descriptor code>
- * proc
- * plimit
- */
-#define LIM_LOCK(lim) mtx_lock(&(lim)->pl_mtx)
-#define LIM_UNLOCK(lim) mtx_unlock(&(lim)->pl_mtx)
-#define LIM_LOCK_ASSERT(lim, f) mtx_assert(&(lim)->pl_mtx, (f))
+#define LIM_LOCK(lim) mtx_lock((lim)->pl_mtx)
+#define LIM_UNLOCK(lim) mtx_unlock((lim)->pl_mtx)
+#define LIM_LOCK_ASSERT(lim, f) mtx_assert((lim)->pl_mtx, (f))
/*
* Per uid resource consumption
OpenPOWER on IntegriCloud