Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys fix lkm malloc lossage.



details:   https://anonhg.NetBSD.org/src/rev/9d62ca99b7f2
branches:  trunk
changeset: 546214:9d62ca99b7f2
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Apr 22 17:14:12 2003 +0000

description:
fix lkm malloc lossage.

diffstat:

 sys/miscfs/kernfs/kernfs_vfsops.c |  10 ++++++++--
 sys/ufs/mfs/mfs_vfsops.c          |  10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r ab6492204532 -r 9d62ca99b7f2 sys/miscfs/kernfs/kernfs_vfsops.c
--- a/sys/miscfs/kernfs/kernfs_vfsops.c Tue Apr 22 17:04:06 2003 +0000
+++ b/sys/miscfs/kernfs/kernfs_vfsops.c Tue Apr 22 17:14:12 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernfs_vfsops.c,v 1.48 2003/04/16 21:44:23 christos Exp $      */
+/*     $NetBSD: kernfs_vfsops.c,v 1.49 2003/04/22 17:14:12 christos Exp $      */
 
 /*
  * Copyright (c) 1992, 1993, 1995
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.48 2003/04/16 21:44:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.49 2003/04/22 17:14:12 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -88,11 +88,17 @@
 void
 kernfs_init()
 {
+#ifdef _LKM
+       malloc_type_attach(M_KERNFSMNT);
+#endif
 }
 
 void
 kernfs_done()
 {
+#ifdef _LKM
+       malloc_type_detach(M_KERNFSMNT);
+#endif
 }
 
 void
diff -r ab6492204532 -r 9d62ca99b7f2 sys/ufs/mfs/mfs_vfsops.c
--- a/sys/ufs/mfs/mfs_vfsops.c  Tue Apr 22 17:04:06 2003 +0000
+++ b/sys/ufs/mfs/mfs_vfsops.c  Tue Apr 22 17:14:12 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mfs_vfsops.c,v 1.47 2003/04/22 13:18:52 christos Exp $ */
+/*     $NetBSD: mfs_vfsops.c,v 1.48 2003/04/22 17:16:21 christos Exp $ */
 
 /*
  * Copyright (c) 1989, 1990, 1993, 1994
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.47 2003/04/22 13:18:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.48 2003/04/22 17:16:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -113,6 +113,9 @@
 void
 mfs_init()
 {
+#ifdef _LKM
+       malloc_type_attach(M_MFSNODE);
+#endif
        /*
         * ffs_init() ensures to initialize necessary resources
         * only once.
@@ -134,6 +137,9 @@
         * only once, when it's no more needed.
         */
        ffs_done();
+#ifdef _LKM
+       malloc_type_detach(M_MFSNODE);
+#endif
 }
 
 /*



Home | Main Index | Thread Index | Old Index