summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_exit.c4
-rw-r--r--sys/kern/kern_fork.c5
-rw-r--r--sys/kern/kern_proc.c5
-rw-r--r--sys/sys/proc.h3
4 files changed, 10 insertions, 7 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index a1adcbc52ff..8224f0e2e87 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.39 2002/01/23 15:46:48 art Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.40 2002/01/25 15:00:26 art Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -536,7 +536,7 @@ proc_zap(p)
*/
if (--p->p_cred->p_refcnt == 0) {
crfree(p->p_cred->pc_ucred);
- FREE(p->p_cred, M_SUBPROC);
+ pool_put(&pcred_pool, p->p_cred);
}
/*
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 57b1c939195..9398e868227 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.48 2002/01/16 20:50:17 miod Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.49 2002/01/25 15:00:26 art Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -272,8 +272,7 @@ again:
if (p1->p_flag & P_PROFIL)
startprofclock(p2);
p2->p_flag |= (p1->p_flag & (P_SUGID | P_SUGIDEXEC));
- MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred),
- M_SUBPROC, M_WAITOK);
+ p2->p_cred = pool_get(&pcred_pool, PR_WAITOK);
bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred));
p2->p_cred->p_refcnt = 1;
crhold(p1->p_ucred);
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 1879f9bf293..d3d8cfeb7a9 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_proc.c,v 1.11 2002/01/23 15:46:48 art Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.12 2002/01/25 15:00:26 art Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
@@ -80,6 +80,7 @@ struct pool rusage_pool;
struct pool ucred_pool;
struct pool pgrp_pool;
struct pool session_pool;
+struct pool pcred_pool;
/*
* Locking of this proclist is special; it's accessed in a
@@ -123,6 +124,8 @@ procinit()
&pool_allocator_nointr);
pool_init(&session_pool, sizeof(struct session), 0, 0, 0, "sessionpl",
&pool_allocator_nointr);
+ pool_init(&pcred_pool, sizeof(struct pcred), 0, 0, 0, "pcredpl",
+ &pool_allocator_nointr);
}
/*
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index fa824cfbffe..00fccb5b671 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.53 2002/01/23 15:46:48 art Exp $ */
+/* $OpenBSD: proc.h,v 1.54 2002/01/25 15:00:26 art Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -342,6 +342,7 @@ extern struct pool proc_pool; /* memory pool for procs */
extern struct pool rusage_pool; /* memory pool for zombies */
extern struct pool ucred_pool; /* memory pool for ucreds */
extern struct pool session_pool; /* memory pool for sessions */
+extern struct pool pcred_pool; /* memory pool for pcreds */
#define NQS 32 /* 32 run queues. */
int whichqs; /* Bit mask summary of non-empty Q's. */