diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-03-22 00:11:37 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-03-22 00:11:37 +0000 |
commit | 88e82e5757de59729f6c52b467a8575e69a41a4c (patch) | |
tree | 321f57b5896389a440616b932c4b000a8121c8af /sys/ufs/ffs/ffs_vfsops.c | |
parent | 9f18d5ce67252e97b0042976a12c5109fab05548 (diff) |
Change the ffs inode allocation from using malloc to pool.
Saves approx. 256k memory on a GENERIC i386 and moves 670k out of kmem_map.
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 8af365edf8a..503491f0696 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.32 2001/03/14 18:46:18 gluk Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.33 2001/03/22 00:11:36 art Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -52,6 +52,7 @@ #include <sys/errno.h> #include <sys/malloc.h> #include <sys/sysctl.h> +#include <sys/pool.h> #include <dev/rndvar.h> @@ -90,6 +91,8 @@ extern u_long nextgennumber; * Called by main() when ufs is going to be mounted as root. */ +struct pool ffs_ino_pool; + int ffs_mountroot() { @@ -967,7 +970,7 @@ ffs_vget(mp, ino, vpp) struct buf *bp; struct vnode *vp; dev_t dev; - int type, error; + int error; ump = VFSTOUFS(mp); dev = ump->um_dev; @@ -984,8 +987,8 @@ retry: #ifdef LOCKDEBUG vp->v_flag |= VLOCKSWORK; #endif - type = ump->um_devvp->v_tag == VT_MFS ? M_MFSNODE : M_FFSNODE; /* XXX */ - MALLOC(ip, struct inode *, sizeof(struct inode), type, M_WAITOK); + /* XXX - we use the same pool for ffs and mfs */ + ip = pool_get(&ffs_ino_pool, M_WAITOK); bzero((caddr_t)ip, sizeof(struct inode)); lockinit(&ip->i_lock, PINOD, "inode", 0, 0); vp->v_data = ip; @@ -1199,6 +1202,9 @@ int ffs_init(vfsp) struct vfsconf *vfsp; { + + pool_init(&ffs_ino_pool, sizeof(struct inode), 0, 0, 0, "ffsino", + 0, pool_page_alloc_nointr, pool_page_free_nointr, M_FFSNODE); softdep_initialize(); return (ufs_init(vfsp)); } |