summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-02-20 04:18:42 +0000
committertjr <tjr@FreeBSD.org>2003-02-20 04:18:42 +0000
commit569e9d1a868a053312375c90c3f0c7ab35d18e47 (patch)
tree28ed51036df7221547d852601de750f3a017c7e6 /sys/kern/kern_fork.c
parentc812b91a675fc33d56c494228f512aef76f65480 (diff)
downloadFreeBSD-src-569e9d1a868a053312375c90c3f0c7ab35d18e47.zip
FreeBSD-src-569e9d1a868a053312375c90c3f0c7ab35d18e47.tar.gz
Remove the PL_SHAREMOD flag from struct plimit, which could have been
used to share resource limits between rfork threads, but never was. Removing it makes resource limit locking much simpler -- only the current process can change the contents of the structure that p_limit points to.
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 5c36a24..19f506c 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -558,17 +558,10 @@ again:
PROC_UNLOCK(p2);
/*
- * If p_limit is still copy-on-write, bump refcnt,
- * otherwise get a copy that won't be modified.
- * (If PL_SHAREMOD is clear, the structure is shared
- * copy-on-write.)
+ * p_limit is copy-on-write, bump refcnt,
*/
- if (p1->p_limit->p_lflags & PL_SHAREMOD)
- p2->p_limit = limcopy(p1->p_limit);
- else {
- p2->p_limit = p1->p_limit;
- p2->p_limit->p_refcnt++;
- }
+ p2->p_limit = p1->p_limit;
+ p2->p_limit->p_refcnt++;
/*
* Setup linkage for kernel based threading
OpenPOWER on IntegriCloud