add flags arg to hashinit(), to pass to malloc().

This commit is contained in:
chs 1998-02-07 02:44:44 +00:00
parent 0711fdaf0b
commit f64abc7b4c
17 changed files with 41 additions and 41 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */
/* $NetBSD: cd9660_node.c,v 1.18 1998/02/07 02:44:44 chs Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1994
@ -81,9 +81,9 @@ void
cd9660_init()
{
isohashtbl = hashinit(desiredvnodes, M_ISOFSMNT, &isohash);
isohashtbl = hashinit(desiredvnodes, M_ISOFSMNT, M_WAITOK, &isohash);
#ifdef ISODEVMAP
idvhashtbl = hashinit(desiredvnodes / 8, M_ISOFSMNT, &idvhash);
idvhashtbl = hashinit(desiredvnodes / 8, M_ISOFSMNT, M_WAITOK, &idvhash);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_proc.c,v 1.19 1997/05/21 19:56:50 gwr Exp $ */
/* $NetBSD: kern_proc.c,v 1.20 1998/02/07 02:44:46 chs Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -88,9 +88,9 @@ procinit()
LIST_INIT(&allproc);
LIST_INIT(&zombproc);
pidhashtbl = hashinit(maxproc / 4, M_PROC, &pidhash);
pgrphashtbl = hashinit(maxproc / 4, M_PROC, &pgrphash);
uihashtbl = hashinit(maxproc / 16, M_PROC, &uihash);
pidhashtbl = hashinit(maxproc / 4, M_PROC, M_WAITOK, &pidhash);
pgrphashtbl = hashinit(maxproc / 4, M_PROC, M_WAITOK, &pgrphash);
uihashtbl = hashinit(maxproc / 16, M_PROC, M_WAITOK, &uihash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_subr.c,v 1.32 1998/02/05 07:59:55 mrg Exp $ */
/* $NetBSD: kern_subr.c,v 1.33 1998/02/07 02:44:47 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -220,8 +220,8 @@ again:
* General routine to allocate a hash table.
*/
void *
hashinit(elements, type, hashmask)
int elements, type;
hashinit(elements, type, flags, hashmask)
int elements, type, flags;
u_long *hashmask;
{
long hashsize;
@ -233,7 +233,7 @@ hashinit(elements, type, hashmask)
for (hashsize = 1; hashsize <= elements; hashsize <<= 1)
continue;
hashsize >>= 1;
hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, M_WAITOK);
hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), type, flags);
for (i = 0; i < hashsize; i++)
LIST_INIT(&hashtbl[i]);
*hashmask = hashsize - 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_bio.c,v 1.52 1997/07/08 22:03:30 pk Exp $ */
/* $NetBSD: vfs_bio.c,v 1.53 1998/02/07 02:44:48 chs Exp $ */
/*-
* Copyright (c) 1994 Christopher G. Demetriou
@ -139,7 +139,7 @@ bufinit()
for (dp = bufqueues; dp < &bufqueues[BQUEUES]; dp++)
TAILQ_INIT(dp);
bufhashtbl = hashinit(nbuf, M_CACHE, &bufhash);
bufhashtbl = hashinit(nbuf, M_CACHE, M_WAITOK, &bufhash);
base = bufpages / nbuf;
residual = bufpages % nbuf;
for (i = 0; i < nbuf; i++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/* $NetBSD: vfs_cache.c,v 1.14 1998/02/07 02:44:49 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -226,7 +226,7 @@ nchinit()
{
TAILQ_INIT(&nclruhead);
nchashtbl = hashinit(desiredvnodes, M_CACHE, &nchash);
nchashtbl = hashinit(desiredvnodes, M_CACHE, M_WAITOK, &nchash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdesc_vnops.c,v 1.42 1997/10/10 02:00:56 fvdl Exp $ */
/* $NetBSD: fdesc_vnops.c,v 1.43 1998/02/07 02:44:50 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -191,7 +191,7 @@ fdesc_init()
if (cdevsw[cttymajor].d_open == cttyopen)
break;
devctty = makedev(cttymajor, 0);
fdhashtbl = hashinit(NFDCACHE, M_CACHE, &fdhash);
fdhashtbl = hashinit(NFDCACHE, M_CACHE, M_NOWAIT, &fdhash);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: null_subr.c,v 1.9 1997/09/10 13:44:22 christos Exp $ */
/* $NetBSD: null_subr.c,v 1.10 1998/02/07 02:44:51 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -81,7 +81,7 @@ nullfs_init()
#ifdef NULLFS_DIAGNOSTIC
printf("nullfs_init\n"); /* printed during system boot */
#endif
null_node_hashtbl = hashinit(NNULLNODECACHE, M_CACHE, &null_node_hash);
null_node_hashtbl = hashinit(NNULLNODECACHE, M_CACHE, M_WAITOK, &null_node_hash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: umap_subr.c,v 1.11 1997/09/10 13:44:28 christos Exp $ */
/* $NetBSD: umap_subr.c,v 1.12 1998/02/07 02:44:53 chs Exp $ */
/*
* Copyright (c) 1992, 1993
@ -81,7 +81,7 @@ umapfs_init()
#ifdef UMAPFS_DIAGNOSTIC
printf("umapfs_init\n"); /* printed during system boot */
#endif
umap_node_hashtbl = hashinit(NUMAPNODECACHE, M_CACHE, &umap_node_hash);
umap_node_hashtbl = hashinit(NUMAPNODECACHE, M_CACHE, M_WAITOK, &umap_node_hash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_denode.c,v 1.26 1998/02/05 08:00:16 mrg Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.27 1998/02/07 02:44:54 chs Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -82,7 +82,7 @@ static void msdosfs_hashrem __P((struct denode *));
void
msdosfs_init()
{
dehashtbl = hashinit(desiredvnodes/2, M_MSDOSFSMNT, &dehash);
dehashtbl = hashinit(desiredvnodes/2, M_MSDOSFSMNT, M_WAITOK, &dehash);
}
static struct denode *

View File

@ -1,4 +1,4 @@
/* $NetBSD: in_pcb.c,v 1.47 1998/01/08 11:56:50 lukem Exp $ */
/* $NetBSD: in_pcb.c,v 1.48 1998/02/07 02:44:55 chs Exp $ */
/*
* Copyright (c) 1982, 1986, 1991, 1993, 1995
@ -82,9 +82,9 @@ in_pcbinit(table, bindhashsize, connecthashsize)
CIRCLEQ_INIT(&table->inpt_queue);
table->inpt_bindhashtbl =
hashinit(bindhashsize, M_PCB, &table->inpt_bindhash);
hashinit(bindhashsize, M_PCB, M_WAITOK, &table->inpt_bindhash);
table->inpt_connecthashtbl =
hashinit(connecthashsize, M_PCB, &table->inpt_connecthash);
hashinit(connecthashsize, M_PCB, M_WAITOK, &table->inpt_connecthash);
table->inpt_lastlow = IPPORT_RESERVEDMAX;
table->inpt_lastport = (u_int16_t)anonportmax;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_mroute.c,v 1.35 1997/08/14 06:42:33 mycroft Exp $ */
/* $NetBSD: ip_mroute.c,v 1.36 1998/02/07 02:44:57 chs Exp $ */
/*
* IP multicast forwarding procedures
@ -408,7 +408,7 @@ ip_mrouter_init(so, m)
ip_mrouter = so;
mfchashtbl = hashinit(MFCTBLSIZ, M_MRTABLE, &mfchash);
mfchashtbl = hashinit(MFCTBLSIZ, M_MRTABLE, M_WAITOK, &mfchash);
bzero((caddr_t)nexpire, sizeof(nexpire));
pim_assert = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_node.c,v 1.24 1997/10/19 01:46:24 fvdl Exp $ */
/* $NetBSD: nfs_node.c,v 1.25 1998/02/07 02:44:58 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -72,7 +72,7 @@ void
nfs_nhinit()
{
nfsnodehashtbl = hashinit(desiredvnodes, M_NFSNODE, &nfsnodehash);
nfsnodehashtbl = hashinit(desiredvnodes, M_NFSNODE, M_WAITOK, &nfsnodehash);
lockinit(&nfs_hashlock, PINOD, "nfs_hashlock", 0, 0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */
/* $NetBSD: nfs_srvcache.c,v 1.13 1998/02/07 02:44:59 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -143,7 +143,7 @@ void
nfsrv_initcache()
{
nfsrvhashtbl = hashinit(desirednfsrvcache, M_NFSD, &nfsrvhash);
nfsrvhashtbl = hashinit(desirednfsrvcache, M_NFSD, M_WAITOK, &nfsrvhash);
TAILQ_INIT(&nfsrvlruhead);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_subs.c,v 1.52 1998/02/06 08:22:54 mikel Exp $ */
/* $NetBSD: nfs_subs.c,v 1.53 1998/02/07 02:45:00 chs Exp $ */
/*
* Copyright (c) 1989, 1993
@ -1183,7 +1183,7 @@ nfs_initdircache(vp)
np->n_dircachesize = 0;
np->n_dblkno = 1;
np->n_dircache =
hashinit(NFS_DIRHASHSIZ, M_NFSDIROFF, &nfsdirhashmask);
hashinit(NFS_DIRHASHSIZ, M_NFSDIROFF, M_WAITOK, &nfsdirhashmask);
TAILQ_INIT(&np->n_dirchain);
if (nmp->nm_flag & NFSMNT_XLATECOOKIE) {
MALLOC(np->n_dirgens, unsigned *,
@ -1447,7 +1447,7 @@ nfs_init()
+ nqsrv_clockskew + nqsrv_writeslack;
NQLOADNOVRAM(nqnfsstarttime);
CIRCLEQ_INIT(&nqtimerhead);
nqfhhashtbl = hashinit(NQLCHSZ, M_NQLEASE, &nqfhhash);
nqfhhashtbl = hashinit(NQLCHSZ, M_NQLEASE, M_WAITOK, &nqfhhash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: systm.h,v 1.73 1998/02/05 08:00:43 mrg Exp $ */
/* $NetBSD: systm.h,v 1.74 1998/02/07 02:45:02 chs Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@ -156,7 +156,7 @@ int lkmenodev __P((void));
#endif
int seltrue __P((dev_t dev, int events, struct proc *p));
void *hashinit __P((int count, int type, u_long *hashmask));
void *hashinit __P((int count, int type, int flags, u_long *hashmask));
int sys_nosys __P((struct proc *, void *, register_t *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_ihash.c,v 1.5 1997/07/15 19:08:18 fvdl Exp $ */
/* $NetBSD: ufs_ihash.c,v 1.6 1998/02/07 02:45:03 chs Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -62,7 +62,7 @@ void
ufs_ihashinit()
{
lockinit(&ufs_hashlock, PINOD, "ufs_hashlock", 0, 0);
ihashtbl = hashinit(desiredvnodes, M_UFSMNT, &ihash);
ihashtbl = hashinit(desiredvnodes, M_UFSMNT, M_WAITOK, &ihash);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_quota.c,v 1.9 1997/06/11 10:10:14 bouyer Exp $ */
/* $NetBSD: ufs_quota.c,v 1.10 1998/02/07 02:45:04 chs Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -680,7 +680,7 @@ void
dqinit()
{
dqhashtbl = hashinit(desiredvnodes, M_DQUOT, &dqhash);
dqhashtbl = hashinit(desiredvnodes, M_DQUOT, M_WAITOK, &dqhash);
TAILQ_INIT(&dqfreelist);
}