Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Explicitly call pool_init() (and pool_destroy()) when be...
details: https://anonhg.NetBSD.org/src/rev/504c5c5759bf
branches: trunk
changeset: 566762:504c5c5759bf
user: atatat <atatat%NetBSD.org@localhost>
date: Thu May 20 05:39:34 2004 +0000
description:
Explicitly call pool_init() (and pool_destroy()) when being built as
an _LKM.
This adds pools to the list of things that lkms must do manually
because they're set up with link sets. Not that there's anything
wrong with link sets, but that we need to try harder to remember that
lkms are second class citizens. Of a sort.
diffstat:
sys/fs/adosfs/advfsops.c | 8 +++++---
sys/fs/cd9660/cd9660_node.c | 8 +++++---
sys/fs/filecorefs/filecore_node.c | 8 +++++---
sys/fs/msdosfs/msdosfs_denode.c | 8 +++++---
sys/fs/smbfs/smbfs_vfsops.c | 7 +++++--
sys/ufs/ext2fs/ext2fs_vfsops.c | 13 +++++++++++--
sys/ufs/ffs/ffs_vfsops.c | 16 ++++++++++++++--
sys/ufs/lfs/lfs_vfsops.c | 12 +++++++++---
8 files changed, 59 insertions(+), 21 deletions(-)
diffs (truncated from 314 to 300 lines):
diff -r 804008e5a52f -r 504c5c5759bf sys/fs/adosfs/advfsops.c
--- a/sys/fs/adosfs/advfsops.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/fs/adosfs/advfsops.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advfsops.c,v 1.14 2004/04/27 17:37:30 jrf Exp $ */
+/* $NetBSD: advfsops.c,v 1.15 2004/05/20 05:39:34 atatat Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.14 2004/04/27 17:37:30 jrf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.15 2004/05/20 05:39:34 atatat Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -817,6 +817,8 @@
malloc_type_attach(M_ADOSFSMNT);
malloc_type_attach(M_ANODE);
malloc_type_attach(M_ADOSFSBITMAP);
+ pool_init(&adosfs_node_pool, sizeof(struct anode), 0, 0, 0, "adosndpl",
+ &pool_allocator_nointr);
#endif
simple_lock_init(&adosfs_hashlock);
}
@@ -824,8 +826,8 @@
void
adosfs_done()
{
+#ifdef _LKM
pool_destroy(&adosfs_node_pool);
-#ifdef _LKM
malloc_type_detach(M_ADOSFSBITMAP);
malloc_type_detach(M_ANODE);
malloc_type_detach(M_ADOSFSMNT);
diff -r 804008e5a52f -r 504c5c5759bf sys/fs/cd9660/cd9660_node.c
--- a/sys/fs/cd9660/cd9660_node.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/fs/cd9660/cd9660_node.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_node.c,v 1.7 2004/04/25 16:42:40 simonb Exp $ */
+/* $NetBSD: cd9660_node.c,v 1.8 2004/05/20 05:39:34 atatat Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.7 2004/04/25 16:42:40 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_node.c,v 1.8 2004/05/20 05:39:34 atatat Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -87,6 +87,8 @@
{
#ifdef _LKM
malloc_type_attach(M_ISOFSMNT);
+ pool_init(&cd9660_node_pool, sizeof(struct iso_node), 0, 0, 0,
+ "cd9660nopl", &pool_allocator_nointr);
#endif
isohashtbl = hashinit(desiredvnodes, HASH_LIST, M_ISOFSMNT, M_WAITOK,
&isohash);
@@ -163,8 +165,8 @@
#ifdef ISODEVMAP
hashdone(idvhashtbl, M_ISOFSMNT);
#endif
+#ifdef _LKM
pool_destroy(&cd9660_node_pool);
-#ifdef _LKM
malloc_type_detach(M_ISOFSMNT);
#endif
}
diff -r 804008e5a52f -r 504c5c5759bf sys/fs/filecorefs/filecore_node.c
--- a/sys/fs/filecorefs/filecore_node.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/fs/filecorefs/filecore_node.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_node.c,v 1.4 2004/04/25 16:42:40 simonb Exp $ */
+/* $NetBSD: filecore_node.c,v 1.5 2004/05/20 05:39:34 atatat Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1994
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.4 2004/04/25 16:42:40 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_node.c,v 1.5 2004/05/20 05:39:34 atatat Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -108,6 +108,8 @@
{
#ifdef _LKM
malloc_type_attach(M_FILECOREMNT);
+ pool_init(&filecore_node_pool, sizeof(struct filecore_node), 0, 0, 0,
+ "filecrnopl", &pool_allocator_nointr);
#endif
filecorehashtbl = hashinit(desiredvnodes, HASH_LIST, M_FILECOREMNT,
M_WAITOK, &filecorehash);
@@ -150,9 +152,9 @@
void
filecore_done()
{
- pool_destroy(&filecore_node_pool);
hashdone(filecorehashtbl, M_FILECOREMNT);
#ifdef _LKM
+ pool_destroy(&filecore_node_pool);
malloc_type_detach(M_FILECOREMNT);
#endif
}
diff -r 804008e5a52f -r 504c5c5759bf sys/fs/msdosfs/msdosfs_denode.c
--- a/sys/fs/msdosfs/msdosfs_denode.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/fs/msdosfs/msdosfs_denode.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_denode.c,v 1.6 2004/04/25 16:42:41 simonb Exp $ */
+/* $NetBSD: msdosfs_denode.c,v 1.7 2004/05/20 05:39:34 atatat Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.6 2004/04/25 16:42:41 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.7 2004/05/20 05:39:34 atatat Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,6 +102,8 @@
#ifdef _LKM
malloc_type_attach(M_MSDOSFSMNT);
malloc_type_attach(M_MSDOSFSFAT);
+ pool_init(&msdosfs_denode_pool, sizeof(struct denode), 0, 0, 0,
+ "msdosnopl", &pool_allocator_nointr);
#endif
dehashtbl = hashinit(desiredvnodes / 2, HASH_LIST, M_MSDOSFSMNT,
M_WAITOK, &dehash);
@@ -144,8 +146,8 @@
msdosfs_done()
{
hashdone(dehashtbl, M_MSDOSFSMNT);
+#ifdef _LKM
pool_destroy(&msdosfs_denode_pool);
-#ifdef _LKM
malloc_type_detach(M_MSDOSFSFAT);
malloc_type_detach(M_MSDOSFSMNT);
#endif
diff -r 804008e5a52f -r 504c5c5759bf sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/fs/smbfs/smbfs_vfsops.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_vfsops.c,v 1.40 2004/05/04 13:26:58 jrf Exp $ */
+/* $NetBSD: smbfs_vfsops.c,v 1.41 2004/05/20 05:39:34 atatat Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.40 2004/05/04 13:26:58 jrf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.41 2004/05/20 05:39:34 atatat Exp $");
#ifdef _KERNEL_OPT
#include "opt_quota.h"
@@ -365,6 +365,8 @@
malloc_type_attach(M_SMBNODENAME);
malloc_type_attach(M_SMBFSDATA);
malloc_type_attach(M_SMBFSHASH);
+ pool_init(&smbfs_node_pool, sizeof(struct smbnode), 0, 0, 0,
+ "smbfsnopl", &pool_allocator_nointr);
#endif
SMBVDEBUG("init.\n");
@@ -385,6 +387,7 @@
#ifdef _LKM
/* Need explicit detach if LKM */
+ pool_destroy(&smbfs_node_pool);
malloc_type_detach(M_SMBNODENAME);
malloc_type_detach(M_SMBFSDATA);
malloc_type_detach(M_SMBFSHASH);
diff -r 804008e5a52f -r 504c5c5759bf sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_vfsops.c,v 1.69 2004/05/02 06:59:20 wiz Exp $ */
+/* $NetBSD: ext2fs_vfsops.c,v 1.70 2004/05/20 05:39:34 atatat Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.69 2004/05/02 06:59:20 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.70 2004/05/20 05:39:34 atatat Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -159,6 +159,12 @@
void
ext2fs_init()
{
+#ifdef _LKM
+ pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, 0,
+ "ext2fsinopl", &pool_allocator_nointr);
+ pool_init(&ext2fs_dinode_pool, sizeof(struct ext2fs_dinode), 0, 0, 0,
+ "ext2dinopl", &pool_allocator_nointr);
+#endif
ufs_init();
}
@@ -172,7 +178,10 @@
ext2fs_done()
{
ufs_done();
+#ifdef _LKM
pool_destroy(&ext2fs_inode_pool);
+ pool_destroy(&ext2fs_dinode_pool);
+#endif
}
/*
diff -r 804008e5a52f -r 504c5c5759bf sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.146 2004/04/26 01:40:40 simonb Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.147 2004/05/20 05:39:34 atatat Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.146 2004/04/26 01:40:40 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.147 2004/05/20 05:39:34 atatat Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -1524,6 +1524,14 @@
if (ffs_initcount++ > 0)
return;
+#ifdef _LKM
+ pool_init(&ffs_inode_pool, sizeof(struct inode), 0, 0, 0,
+ "ffsinopl", &pool_allocator_nointr);
+ pool_init(&ffs_dinode1_pool, sizeof(struct ufs1_dinode), 0, 0, 0,
+ "dino1pl", &pool_allocator_nointr);
+ pool_init(&ffs_dinode2_pool, sizeof(struct ufs2_dinode), 0, 0, 0,
+ "dino2pl", &pool_allocator_nointr);
+#endif
softdep_initialize();
ufs_init();
}
@@ -1543,7 +1551,11 @@
/* XXX softdep cleanup ? */
ufs_done();
+#ifdef _LKM
+ pool_destroy(&ffs_dinode2_pool);
+ pool_destroy(&ffs_dinode1_pool);
pool_destroy(&ffs_inode_pool);
+#endif
}
SYSCTL_SETUP(sysctl_vfs_ffs_setup, "sysctl vfs.ffs subtree setup")
diff -r 804008e5a52f -r 504c5c5759bf sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c Thu May 20 05:08:29 2004 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c Thu May 20 05:39:34 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.149 2004/04/25 16:42:44 simonb Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.150 2004/05/20 05:39:35 atatat Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.149 2004/04/25 16:42:44 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.150 2004/05/20 05:39:35 atatat Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -257,6 +257,12 @@
{
#ifdef _LKM
malloc_type_attach(M_SEGMENT);
+ pool_init(&lfs_inode_pool, sizeof(struct inode), 0, 0, 0,
+ "lfsinopl", &pool_allocator_nointr);
+ pool_init(&lfs_dinode_pool, sizeof(struct ufs1_dinode), 0, 0, 0,
+ "lfsdinopl", &pool_allocator_nointr);
+ pool_init(&lfs_inoext_pool, sizeof(struct lfs_inode_ext), 8, 0, 0,
+ "lfsinoextpl", &pool_allocator_nointr);
#endif
Home |
Main Index |
Thread Index |
Old Index