summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-06-29 20:14:47 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-06-29 20:14:47 +0000
commit5f668482a0ee7fdb423c438a5d51c31ab892ec1e (patch)
tree1f0a54a53da585e1f349df7fadab420f326bbcd0
parentabdb9c7ff6417c26618514872b4bd4a27e71a1f6 (diff)
Eliminate struct plimit's PL_SHAREMOD flag: it was for COMPAT_IRIX
sproc() support, but we don't have COMPAT_IRIX. ok krw@ tedu@
-rw-r--r--sys/kern/kern_fork.c16
-rw-r--r--sys/kern/kern_resource.c6
-rw-r--r--sys/sys/resourcevar.h11
3 files changed, 8 insertions, 25 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 5467a1710fb..4a1c23ba336 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.114 2010/06/29 00:35:28 tedu Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.115 2010/06/29 20:14:46 guenther Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -300,19 +300,9 @@ fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t stacksize,
else
p2->p_fd = fdcopy(p1);
- /*
- * If ps_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.)
- */
if ((flags & FORK_THREAD) == 0) {
- if (p1->p_p->ps_limit->p_lflags & PL_SHAREMOD)
- p2->p_p->ps_limit = limcopy(p1->p_p->ps_limit);
- else {
- p2->p_p->ps_limit = p1->p_p->ps_limit;
- p2->p_p->ps_limit->p_refcnt++;
- }
+ p2->p_p->ps_limit = p1->p_p->ps_limit;
+ p2->p_p->ps_limit->p_refcnt++;
}
if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT)
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index bb33c7756dd..9bf4e2eab72 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.34 2010/01/04 02:48:56 guenther Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.35 2010/06/29 20:14:46 guenther Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -229,8 +229,7 @@ dosetrlimit(struct proc *p, u_int which, struct rlimit *limp)
limp->rlim_max > alimp->rlim_max)
if ((error = suser(p, 0)) != 0)
return (error);
- if (p->p_p->ps_limit->p_refcnt > 1 &&
- (p->p_p->ps_limit->p_lflags & PL_SHAREMOD) == 0) {
+ if (p->p_p->ps_limit->p_refcnt > 1) {
struct plimit *l = p->p_p->ps_limit;
/* limcopy() can sleep, so copy before decrementing refcnt */
@@ -422,7 +421,6 @@ limcopy(struct plimit *lim)
newlim = pool_get(&plimit_pool, PR_WAITOK);
bcopy(lim->pl_rlimit, newlim->pl_rlimit,
sizeof(struct rlimit) * RLIM_NLIMITS);
- newlim->p_lflags = 0;
newlim->p_refcnt = 1;
return (newlim);
}
diff --git a/sys/sys/resourcevar.h b/sys/sys/resourcevar.h
index a50c7cb87c2..e1c636d6a82 100644
--- a/sys/sys/resourcevar.h
+++ b/sys/sys/resourcevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: resourcevar.h,v 1.11 2007/03/15 10:22:30 art Exp $ */
+/* $OpenBSD: resourcevar.h,v 1.12 2010/06/29 20:14:46 guenther Exp $ */
/* $NetBSD: resourcevar.h,v 1.12 1995/11/22 23:01:53 cgd Exp $ */
/*
@@ -65,16 +65,11 @@ struct pstats {
/*
* Kernel shareable process resource limits. Because this structure
- * is moderately large but changes infrequently, it is normally
- * shared copy-on-write after forks. If a group of processes
- * ("threads") share modifications, the PL_SHAREMOD flag is set,
- * and a copy must be made for the child of a new fork that isn't
- * sharing modifications to the limits.
+ * is moderately large but changes infrequently, it is shared
+ * copy-on-write after forks.
*/
struct plimit {
struct rlimit pl_rlimit[RLIM_NLIMITS];
-#define PL_SHAREMOD 0x01 /* modifications are shared */
- int p_lflags;
int p_refcnt; /* number of references */
};