diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2008-09-12 12:27:28 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2008-09-12 12:27:28 +0000 |
commit | 6eaa573d6f08d7ebea8666da09484d6ce9f4e1ba (patch) | |
tree | 1de1fd591ef2ef103da41de655e40046def9c401 | |
parent | 19df77e4137aaf9261cf8b8f72e6bb66ea8fda77 (diff) |
Remove bzero/memset calls after pool_gets by passing the PR_ZERO
flag to the pool_get call.
ok art@, krw@
-rw-r--r-- | sys/arch/alpha/alpha/pmap.c | 5 | ||||
-rw-r--r-- | sys/arch/sh/sh/pmap.c | 5 | ||||
-rw-r--r-- | sys/dev/systrace.c | 8 | ||||
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 5 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 5 |
5 files changed, 11 insertions, 17 deletions
diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index 23fa12cc117..21e931730df 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.56 2008/09/12 08:43:18 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.57 2008/09/12 12:27:26 blambert Exp $ */ /* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */ /*- @@ -1167,8 +1167,7 @@ pmap_create(void) printf("pmap_create()\n"); #endif - pmap = pool_get(&pmap_pmap_pool, PR_WAITOK); - memset(pmap, 0, sizeof(*pmap)); + pmap = pool_get(&pmap_pmap_pool, PR_WAITOK|PR_ZERO); pmap->pm_asn = pool_get(&pmap_asn_pool, PR_WAITOK); pmap->pm_asngen = pool_get(&pmap_asngen_pool, PR_WAITOK); diff --git a/sys/arch/sh/sh/pmap.c b/sys/arch/sh/sh/pmap.c index d9549b052c6..bc9b7e4a7bc 100644 --- a/sys/arch/sh/sh/pmap.c +++ b/sys/arch/sh/sh/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.9 2008/06/26 05:42:13 ray Exp $ */ +/* $OpenBSD: pmap.c,v 1.10 2008/09/12 12:27:27 blambert Exp $ */ /* $NetBSD: pmap.c,v 1.55 2006/08/07 23:19:36 tsutsui Exp $ */ /*- @@ -215,8 +215,7 @@ pmap_create() { pmap_t pmap; - pmap = pool_get(&__pmap_pmap_pool, PR_WAITOK); - memset(pmap, 0, sizeof(struct pmap)); + pmap = pool_get(&__pmap_pmap_pool, PR_WAITOK|PR_ZERO); pmap->pm_asid = -1; pmap->pm_refcnt = 1; /* Allocate page table page holder (512 slot) */ diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c index 9bce33ffe02..1efc6d3af8a 100644 --- a/sys/dev/systrace.c +++ b/sys/dev/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.47 2008/01/05 07:33:37 brad Exp $ */ +/* $OpenBSD: systrace.c,v 1.48 2008/09/12 12:27:27 blambert Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -1802,8 +1802,7 @@ systrace_msg_child(struct fsystrace *fst, struct str_process *strp, pid_t npid) struct str_message *msg; struct str_msg_child *msg_child; - nstrp = pool_get(&systr_proc_pl, PR_WAITOK); - memset(nstrp, 0, sizeof(struct str_process)); + nstrp = pool_get(&systr_proc_pl, PR_WAITOK|PR_ZERO); DPRINTF(("%s: %p: pid %d -> pid %d\n", __func__, nstrp, strp->pid, npid)); @@ -1832,8 +1831,7 @@ systrace_msg_policyfree(struct fsystrace *fst, struct str_policy *strpol) struct str_process *nstrp; struct str_message *msg; - nstrp = pool_get(&systr_proc_pl, PR_WAITOK); - memset(nstrp, 0, sizeof(struct str_process)); + nstrp = pool_get(&systr_proc_pl, PR_WAITOK|PR_ZERO); DPRINTF(("%s: free %d\n", __func__, strpol->nr)); diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 163923c8d38..5b5e6bc046c 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.49 2007/10/06 23:50:55 krw Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.50 2008/09/12 12:27:27 blambert Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -828,8 +828,7 @@ ext2fs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) return (error); } - ip = pool_get(&ext2fs_inode_pool, PR_WAITOK); - memset(ip, 0, sizeof(struct inode)); + ip = pool_get(&ext2fs_inode_pool, PR_WAITOK|PR_ZERO); lockinit(&ip->i_lock, PINOD, "inode", 0, 0); vp->v_data = ip; ip->i_vnode = vp; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 926ec92d59d..f0bd52cbeb3 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.116 2008/08/08 23:49:53 krw Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.117 2008/09/12 12:27:27 blambert Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1254,8 +1254,7 @@ retry: #ifdef VFSDEBUG vp->v_flag |= VLOCKSWORK; #endif - ip = pool_get(&ffs_ino_pool, PR_WAITOK); - bzero((caddr_t)ip, sizeof(struct inode)); + ip = pool_get(&ffs_ino_pool, PR_WAITOK|PR_ZERO); lockinit(&ip->i_lock, PINOD, "inode", 0, 0); ip->i_ump = ump; VREF(ip->i_devvp); |