Use the pool allocator and the "nointr" pool page allocator for adosfs nodes.

This commit is contained in:
thorpej 1998-09-01 03:33:26 +00:00
parent 38cf17f475
commit d0bcffb9a3
3 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: adosfs.h,v 1.14 1998/08/09 17:54:50 kleink Exp $ */
/* $NetBSD: adosfs.h,v 1.15 1998/09/01 03:33:26 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -144,6 +144,8 @@ struct adosfsmount {
#define OFS_DATA_OFFSET (24)
extern struct pool adosfs_node_pool;
/*
* utility protos
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: advfsops.c,v 1.30 1998/08/09 20:20:11 perry Exp $ */
/* $NetBSD: advfsops.c,v 1.31 1998/09/01 03:33:27 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -42,6 +42,7 @@
#include <sys/proc.h>
#include <sys/time.h>
#include <sys/malloc.h>
#include <sys/pool.h>
#include <sys/disklabel.h>
#include <miscfs/specfs/specdev.h> /* XXX */
#include <sys/fcntl.h>
@ -72,6 +73,8 @@ int adosfs_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,
struct simplelock adosfs_hashlock;
struct pool adosfs_node_pool;
int
adosfs_mount(mp, path, data, ndp, p)
struct mount *mp;
@ -382,7 +385,7 @@ adosfs_vget(mp, an, vpp)
/*
* setup, insert in hash, and lock before io.
*/
vp->v_data = ap = malloc(sizeof(struct anode), M_ANODE, M_WAITOK);
vp->v_data = ap = pool_get(&adosfs_node_pool, PR_WAITOK);
memset(ap, 0, sizeof(struct anode));
ap->vp = vp;
ap->amp = amp;
@ -757,6 +760,10 @@ void
adosfs_init()
{
simple_lock_init(&adosfs_hashlock);
pool_init(&adosfs_node_pool, sizeof(struct anode), 0, 0, 0,
"adosndpl", 0, pool_page_alloc_nointr, pool_page_free_nointr,
M_ANODE);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: advnops.c,v 1.45 1998/08/19 13:12:40 kleink Exp $ */
/* $NetBSD: advnops.c,v 1.46 1998/09/01 03:33:27 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -45,6 +45,7 @@
#include <sys/buf.h>
#include <sys/dirent.h>
#include <sys/malloc.h>
#include <sys/pool.h>
#include <sys/stat.h>
#include <sys/unistd.h>
#include <sys/proc.h>
@ -926,7 +927,7 @@ adosfs_reclaim(v)
free(ap->tab, M_ANODE);
else if (vp->v_type == VLNK && ap->slinkto)
free(ap->slinkto, M_ANODE);
free(ap, M_ANODE);
pool_put(&adosfs_node_pool, ap);
vp->v_data = NULL;
return(0);
}