diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2010-07-03 03:04:56 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2010-07-03 03:04:56 +0000 |
commit | 511aa257d25a10558196d79662c9ecbf300cb455 (patch) | |
tree | c23fb86c5b654e63cc30707f8af1c7eec9ef1fee /sys/kern | |
parent | ba0fe373dd7ab9eb76af982a1eb62958ce275ce9 (diff) |
explicitly specify flags to malloc and pool_get instead of relying on 0.
This is more clear, and as thib pointed out, the default in softraid was
wrong. ok thib.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_extent.c | 5 | ||||
-rw-r--r-- | sys/kern/subr_pool.c | 5 | ||||
-rw-r--r-- | sys/kern/sysv_shm.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c index 234355dd121..1c0101962f2 100644 --- a/sys/kern/subr_extent.c +++ b/sys/kern/subr_extent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_extent.c,v 1.43 2010/06/20 17:57:09 phessler Exp $ */ +/* $OpenBSD: subr_extent.c,v 1.44 2010/07/03 03:04:55 tedu Exp $ */ /* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */ /*- @@ -1102,7 +1102,8 @@ extent_alloc_region_descriptor(struct extent *ex, int flags) } alloc: - rp = pool_get(&ex_region_pl, (flags & EX_WAITOK) ? PR_WAITOK : 0); + rp = pool_get(&ex_region_pl, (flags & EX_WAITOK) ? PR_WAITOK : + PR_NOWAIT); if (rp != NULL) rp->er_flags = ER_ALLOC; diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index cd856ea8e68..4516c2c1bc9 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.95 2010/07/02 01:25:05 art Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.96 2010/07/03 03:04:55 tedu Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -439,7 +439,8 @@ pool_alloc_item_header(struct pool *pp, caddr_t storage, int flags) if ((pp->pr_roflags & PR_PHINPAGE) != 0) ph = (struct pool_item_header *)(storage + pp->pr_phoffset); else - ph = pool_get(&phpool, flags & ~(PR_WAITOK | PR_ZERO)); + ph = pool_get(&phpool, (flags & ~(PR_WAITOK | PR_ZERO)) | + PR_NOWAIT); return (ph); } diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 5496b7908be..50f03b9e41c 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.50 2009/06/02 12:11:16 guenther Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.51 2010/07/03 03:04:55 tedu Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -411,7 +411,8 @@ shmget_allocate_segment(struct proc *p, * the key we want in the meantime. Yes, this is ugly. */ key = SCARG(uap, key); - shmseg = pool_get(&shm_pool, key == IPC_PRIVATE ? PR_WAITOK : 0); + shmseg = pool_get(&shm_pool, key == IPC_PRIVATE ? PR_WAITOK : + PR_NOWAIT); if (shmseg == NULL) { shmseg = pool_get(&shm_pool, PR_WAITOK); if (shm_find_segment_by_key(key) != -1) { |