Module Name:    src
Committed By:   rmind
Date:           Sun Apr 24 18:46:24 UTC 2011

Modified Files:
        src/sys/kern: exec_aout.c exec_ecoff.c kern_ksyms.c kern_pax.c
            kern_softint.c subr_autoconf.c subr_blist.c subr_prf.c
            subr_userconf.c uipc_mbuf.c uipc_socket2.c uipc_syscalls.c
            vfs_bio.c
        src/sys/sys: device.h event.h file.h namei.h namei.src

Log Message:
- Replace few malloc(9) uses with kmem(9).
- Rename buf_malloc() to buf_alloc(), fix comments.
- Remove some unnecessary inclusions.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/exec_aout.c \
    src/sys/kern/kern_softint.c
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/exec_ecoff.c
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/kern_ksyms.c
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_pax.c
cvs rdiff -u -r1.214 -r1.215 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_blist.c
cvs rdiff -u -r1.139 -r1.140 src/sys/kern/subr_prf.c src/sys/kern/uipc_mbuf.c
cvs rdiff -u -r1.20 -r1.21 src/sys/kern/subr_userconf.c
cvs rdiff -u -r1.107 -r1.108 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.142 -r1.143 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.228 -r1.229 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.138 -r1.139 src/sys/sys/device.h
cvs rdiff -u -r1.21 -r1.22 src/sys/sys/event.h
cvs rdiff -u -r1.73 -r1.74 src/sys/sys/file.h
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/namei.h
cvs rdiff -u -r1.23 -r1.24 src/sys/sys/namei.src

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/exec_aout.c
diff -u src/sys/kern/exec_aout.c:1.34 src/sys/kern/exec_aout.c:1.35
--- src/sys/kern/exec_aout.c:1.34	Wed Nov 19 18:36:06 2008
+++ src/sys/kern/exec_aout.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_aout.c,v 1.34 2008/11/19 18:36:06 ad Exp $	*/
+/*	$NetBSD: exec_aout.c,v 1.35 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_aout.c,v 1.34 2008/11/19 18:36:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_aout.c,v 1.35 2011/04/24 18:46:22 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_coredump.h"
@@ -40,7 +40,6 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <sys/malloc.h>
 #include <sys/vnode.h>
 #include <sys/exec.h>
 #include <sys/exec_aout.h>
Index: src/sys/kern/kern_softint.c
diff -u src/sys/kern/kern_softint.c:1.34 src/sys/kern/kern_softint.c:1.35
--- src/sys/kern/kern_softint.c:1.34	Mon Apr 11 19:13:54 2011
+++ src/sys/kern/kern_softint.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_softint.c,v 1.34 2011/04/11 19:13:54 rmind Exp $	*/
+/*	$NetBSD: kern_softint.c,v 1.35 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -176,10 +176,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.34 2011/04/11 19:13:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.35 2011/04/24 18:46:22 rmind Exp $");
 
 #include <sys/param.h>
-#include <sys/malloc.h>
 #include <sys/proc.h>
 #include <sys/intr.h>
 #include <sys/mutex.h>

Index: src/sys/kern/exec_ecoff.c
diff -u src/sys/kern/exec_ecoff.c:1.28 src/sys/kern/exec_ecoff.c:1.29
--- src/sys/kern/exec_ecoff.c:1.28	Wed Nov 19 21:29:32 2008
+++ src/sys/kern/exec_ecoff.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_ecoff.c,v 1.28 2008/11/19 21:29:32 cegger Exp $	*/
+/*	$NetBSD: exec_ecoff.c,v 1.29 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*
  * Copyright (c) 1994 Adam Glass
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_ecoff.c,v 1.28 2008/11/19 21:29:32 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_ecoff.c,v 1.29 2011/04/24 18:46:22 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_coredump.h"
@@ -42,7 +42,6 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
-#include <sys/malloc.h>
 #include <sys/vnode.h>
 #include <sys/exec.h>
 #include <sys/resourcevar.h>

Index: src/sys/kern/kern_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.62 src/sys/kern/kern_ksyms.c:1.63
--- src/sys/kern/kern_ksyms.c:1.62	Tue Jan  4 01:40:19 2011
+++ src/sys/kern/kern_ksyms.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.62 2011/01/04 01:40:19 matt Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.63 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.62 2011/01/04 01:40:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.63 2011/04/24 18:46:22 rmind Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -280,7 +280,7 @@
 	char *str;
 	int nsyms = symsize / sizeof(Elf_Sym);
 
-	/* sanity check for pre-malloc map table used during startup */
+	/* Sanity check for pre-allocated map table used during startup. */
 	if ((nmap == ksyms_nmap) && (nsyms >= KSYMS_MAX_ID)) {
 		printf("kern_ksyms: ERROR %d > %d, increase KSYMS_MAX_ID\n",
 		    nsyms, KSYMS_MAX_ID);

Index: src/sys/kern/kern_pax.c
diff -u src/sys/kern/kern_pax.c:1.24 src/sys/kern/kern_pax.c:1.25
--- src/sys/kern/kern_pax.c:1.24	Mon Aug 23 20:53:08 2010
+++ src/sys/kern/kern_pax.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_pax.c,v 1.24 2010/08/23 20:53:08 christos Exp $	*/
+/*	$NetBSD: kern_pax.c,v 1.25 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2006 Elad Efrat <e...@netbsd.org>
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.24 2010/08/23 20:53:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.25 2011/04/24 18:46:22 rmind Exp $");
 
 #include "opt_pax.h"
 
@@ -37,7 +37,7 @@
 #include <sys/exec_elf.h>
 #include <sys/pax.h>
 #include <sys/sysctl.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/fileassoc.h>
 #include <sys/syslog.h>
 #include <sys/vnode.h>
@@ -363,19 +363,17 @@
 static void
 pax_segvguard_cb(void *v)
 {
-	struct pax_segvguard_entry *p;
+	struct pax_segvguard_entry *p = v;
 	struct pax_segvguard_uid_entry *up;
 
-	if (v == NULL)
+	if (p == NULL) {
 		return;
-
-	p = v;
+	}
 	while ((up = LIST_FIRST(&p->segv_uids)) != NULL) {
 		LIST_REMOVE(up, sue_list);
-		free(up, M_TEMP);
+		kmem_free(up, sizeof(*up));
 	}
-
-	free(v, M_TEMP);
+	kmem_free(p, sizeof(*p));
 }
 
 /*
@@ -417,7 +415,7 @@
 	 * for it.
 	 */
 	if (p == NULL) {
-		p = malloc(sizeof(*p), M_TEMP, M_WAITOK);
+		p = kmem_alloc(sizeof(*p), KM_SLEEP);
 		fileassoc_add(vp, segvguard_id, p);
 		LIST_INIT(&p->segv_uids);
 
@@ -426,7 +424,7 @@
 		 * The expiry time is when we purge the entry if it didn't
 		 * reach the limit.
 		 */
-		up = malloc(sizeof(*up), M_TEMP, M_WAITOK);
+		up = kmem_alloc(sizeof(*up), KM_SLEEP);
 		up->sue_uid = kauth_cred_getuid(l->l_cred);
 		up->sue_ncrashes = 1;
 		up->sue_expiry = tv.tv_sec + pax_segvguard_expiry;
@@ -455,7 +453,7 @@
 	 */
 	if (!have_uid) {
 		if (crashed) {
-			up = malloc(sizeof(*up), M_TEMP, M_WAITOK);
+			up = kmem_alloc(sizeof(*up), KM_SLEEP);
 			up->sue_uid = uid;
 			up->sue_ncrashes = 1;
 			up->sue_expiry = tv.tv_sec + pax_segvguard_expiry;
@@ -463,7 +461,6 @@
 
 			LIST_INSERT_HEAD(&p->segv_uids, up, sue_list);
 		}
-
 		return (0);
 	}
 

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.214 src/sys/kern/subr_autoconf.c:1.215
--- src/sys/kern/subr_autoconf.c:1.214	Sat Apr  2 08:11:31 2011
+++ src/sys/kern/subr_autoconf.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.214 2011/04/02 08:11:31 mbalmer Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.215 2011/04/24 18:46:22 rmind Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.214 2011/04/02 08:11:31 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.215 2011/04/24 18:46:22 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -88,7 +88,6 @@
 #include <sys/disklabel.h>
 #include <sys/conf.h>
 #include <sys/kauth.h>
-#include <sys/malloc.h>
 #include <sys/kmem.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>

Index: src/sys/kern/subr_blist.c
diff -u src/sys/kern/subr_blist.c:1.9 src/sys/kern/subr_blist.c:1.10
--- src/sys/kern/subr_blist.c:1.9	Fri Jan 20 14:19:40 2006
+++ src/sys/kern/subr_blist.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_blist.c,v 1.9 2006/01/20 14:19:40 yamt Exp $	*/
+/*	$NetBSD: subr_blist.c,v 1.10 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1998 Matthew Dillon.  All Rights Reserved.
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_blist.c,v 1.9 2006/01/20 14:19:40 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_blist.c,v 1.10 2011/04/24 18:46:22 rmind Exp $");
 #if 0
 __FBSDID("$FreeBSD: src/sys/kern/subr_blist.c,v 1.17 2004/06/04 04:03:25 alc Exp $");
 #endif
@@ -96,7 +96,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/blist.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 
 #else
 
@@ -111,8 +111,10 @@
 #include <stdarg.h>
 #include <inttypes.h>
 
-#define malloc(a,b,c)	calloc(a, 1)
-#define free(a,b)	free(a)
+#define	KM_SLEEP 1
+#define	kmem_zalloc(a,b,c) calloc(1, (a))
+#define	kmem_alloc(a,b,c) malloc(a)
+#define	kmem_free(a,b) free(a)
 
 #include "../sys/blist.h"
 
@@ -168,10 +170,6 @@
     blist_blkno_t radix, blist_blkno_t skip, int tab);
 #endif
 
-#ifdef _KERNEL
-static MALLOC_DEFINE(M_BLIST, "blist", "Bitmap allocator");
-#endif
-
 /*
  * blist_create() - create a blist capable of handling up to the specified
  *		    number of blocks
@@ -201,14 +199,14 @@
 		skip = (skip + 1) * BLIST_META_RADIX;
 	}
 
-	bl = malloc(sizeof(struct blist), M_BLIST, M_WAITOK | M_ZERO);
+	bl = kmem_zalloc(sizeof(struct blist), KM_SLEEP);
 
 	bl->bl_blocks = blocks;
 	bl->bl_radix = radix;
 	bl->bl_skip = skip;
 	bl->bl_rootblks = 1 +
 	    blst_radix_init(NULL, bl->bl_radix, bl->bl_skip, blocks);
-	bl->bl_root = malloc(sizeof(blmeta_t) * bl->bl_rootblks, M_BLIST, M_WAITOK);
+	bl->bl_root = kmem_alloc(sizeof(blmeta_t) * bl->bl_rootblks, KM_SLEEP);
 
 #if defined(BLIST_DEBUG)
 	printf(
@@ -229,8 +227,9 @@
 void 
 blist_destroy(blist_t bl)
 {
-	free(bl->bl_root, M_BLIST);
-	free(bl, M_BLIST);
+
+	kmem_free(bl->bl_root, sizeof(blmeta_t) * bl->bl_rootblks);
+	kmem_free(bl, sizeof(struct blist));
 }
 
 /*

Index: src/sys/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.139 src/sys/kern/subr_prf.c:1.140
--- src/sys/kern/subr_prf.c:1.139	Fri Jan 21 17:46:19 2011
+++ src/sys/kern/subr_prf.c	Sun Apr 24 18:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.139 2011/01/21 17:46:19 dyoung Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.140 2011/04/24 18:46:22 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.139 2011/01/21 17:46:19 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.140 2011/04/24 18:46:22 rmind Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipkdb.h"
@@ -59,7 +59,6 @@
 #include <sys/tprintf.h>
 #include <sys/spldebug.h>
 #include <sys/syslog.h>
-#include <sys/malloc.h>
 #include <sys/kprintf.h>
 #include <sys/atomic.h>
 #include <sys/kernel.h>
Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.139 src/sys/kern/uipc_mbuf.c:1.140
--- src/sys/kern/uipc_mbuf.c:1.139	Mon Jan 17 07:13:32 2011
+++ src/sys/kern/uipc_mbuf.c	Sun Apr 24 18:46:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.139 2011/01/17 07:13:32 uebayasi Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.140 2011/04/24 18:46:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.139 2011/01/17 07:13:32 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.140 2011/04/24 18:46:23 rmind Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -73,7 +73,6 @@
 #include <sys/atomic.h>
 #include <sys/cpu.h>
 #include <sys/proc.h>
-#include <sys/malloc.h>
 #define MBTYPES
 #include <sys/mbuf.h>
 #include <sys/kernel.h>

Index: src/sys/kern/subr_userconf.c
diff -u src/sys/kern/subr_userconf.c:1.20 src/sys/kern/subr_userconf.c:1.21
--- src/sys/kern/subr_userconf.c:1.20	Sun Sep 12 16:06:08 2010
+++ src/sys/kern/subr_userconf.c	Sun Apr 24 18:46:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_userconf.c,v 1.20 2010/09/12 16:06:08 drochner Exp $	*/
+/*	$NetBSD: subr_userconf.c,v 1.21 2011/04/24 18:46:23 rmind Exp $	*/
 
 /*
  * Copyright (c) 1996 Mats O Jansson <m...@stacken.kth.se>
@@ -29,14 +29,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_userconf.c,v 1.20 2010/09/12 16:06:08 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_userconf.c,v 1.21 2011/04/24 18:46:23 rmind Exp $");
 
 #include "opt_userconf.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
 #include <sys/time.h>
 
 #include <dev/cons.h>

Index: src/sys/kern/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.107 src/sys/kern/uipc_socket2.c:1.108
--- src/sys/kern/uipc_socket2.c:1.107	Sat Apr  9 23:03:59 2011
+++ src/sys/kern/uipc_socket2.c	Sun Apr 24 18:46:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.107 2011/04/09 23:03:59 christos Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.108 2011/04/24 18:46:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.107 2011/04/09 23:03:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.108 2011/04/24 18:46:23 rmind Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_sb_max.h"
@@ -68,7 +68,6 @@
 #include <sys/proc.h>
 #include <sys/file.h>
 #include <sys/buf.h>
-#include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
 #include <sys/domain.h>

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.142 src/sys/kern/uipc_syscalls.c:1.143
--- src/sys/kern/uipc_syscalls.c:1.142	Sun Apr 10 15:45:33 2011
+++ src/sys/kern/uipc_syscalls.c	Sun Apr 24 18:46:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.142 2011/04/10 15:45:33 christos Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.143 2011/04/24 18:46:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.142 2011/04/10 15:45:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.143 2011/04/24 18:46:23 rmind Exp $");
 
 #include "opt_pipe.h"
 
@@ -71,7 +71,6 @@
 #include <sys/proc.h>
 #include <sys/file.h>
 #include <sys/buf.h>
-#include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/protosw.h>
 #include <sys/socket.h>

Index: src/sys/kern/vfs_bio.c
diff -u src/sys/kern/vfs_bio.c:1.228 src/sys/kern/vfs_bio.c:1.229
--- src/sys/kern/vfs_bio.c:1.228	Wed Mar 23 00:58:38 2011
+++ src/sys/kern/vfs_bio.c	Sun Apr 24 18:46:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_bio.c,v 1.228 2011/03/23 00:58:38 rmind Exp $	*/
+/*	$NetBSD: vfs_bio.c,v 1.229 2011/04/24 18:46:23 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.228 2011/03/23 00:58:38 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.229 2011/04/24 18:46:23 rmind Exp $");
 
 #include "opt_bufcache.h"
 
@@ -177,7 +177,7 @@
 static int buf_canrelease(void);
 static u_long buf_mempoolidx(u_long);
 static u_long buf_roundsize(u_long);
-static void *buf_malloc(size_t);
+static void *buf_alloc(size_t);
 static void buf_mrelease(void *, size_t);
 static void binsheadfree(buf_t *, struct bqueue *);
 static void binstailfree(buf_t *, struct bqueue *);
@@ -623,7 +623,7 @@
 }
 
 static void *
-buf_malloc(size_t size)
+buf_alloc(size_t size)
 {
 	u_int n = buf_mempoolidx(size);
 	void *addr;
@@ -1254,7 +1254,7 @@
 	 * If we want a buffer of a different size, re-allocate the
 	 * buffer's memory; copy old content only if needed.
 	 */
-	addr = buf_malloc(desired_size);
+	addr = buf_alloc(desired_size);
 	if (addr == NULL)
 		return ENOMEM;
 	if (preserve)
@@ -1496,7 +1496,7 @@
  * In real life, the pagedaemon (or other system processes) wants
  * to do async stuff to, and doesn't want the buffer brelse()'d.
  * (for swap pager, that puts swap buffers on the free lists (!!!),
- * for the vn device, that puts malloc'd buffers on the free lists!)
+ * for the vn device, that puts allocated buffers on the free lists!)
  */
 void
 biodone(buf_t *bp)

Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.138 src/sys/sys/device.h:1.139
--- src/sys/sys/device.h:1.138	Mon Jan 31 23:07:17 2011
+++ src/sys/sys/device.h	Sun Apr 24 18:46:24 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.138 2011/01/31 23:07:17 dyoung Exp $ */
+/* $NetBSD: device.h,v 1.139 2011/04/24 18:46:24 rmind Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -308,7 +308,7 @@
 struct cfattach {
 	const char *ca_name;		/* name of attachment */
 	LIST_ENTRY(cfattach) ca_list;	/* link on cfdriver's list */
-	size_t	  ca_devsize;		/* size of dev data (for malloc) */
+	size_t	  ca_devsize;		/* size of dev data (for alloc) */
 	int	  ca_flags;		/* flags for driver allocation etc */
 	int	(*ca_match)(device_t, cfdata_t, void *);
 	void	(*ca_attach)(device_t, device_t, void *);

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.21 src/sys/sys/event.h:1.22
--- src/sys/sys/event.h:1.21	Sun Jan 11 02:45:55 2009
+++ src/sys/sys/event.h	Sun Apr 24 18:46:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.21 2009/01/11 02:45:55 christos Exp $	*/
+/*	$NetBSD: event.h,v 1.22 2011/04/24 18:46:24 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon <jle...@freebsd.org>
@@ -144,9 +144,6 @@
 #define KFILTER_BYNAME		_IOWR('k', 1, struct kfilter_mapping)
 
 #ifdef _KERNEL
-#include <sys/mallocvar.h>		/* for malloc types */
-
-MALLOC_DECLARE(M_KEVENT);
 
 #define	KNOTE(list, hint)	if (!SLIST_EMPTY(list)) knote(list, hint)
 

Index: src/sys/sys/file.h
diff -u src/sys/sys/file.h:1.73 src/sys/sys/file.h:1.74
--- src/sys/sys/file.h:1.73	Sat Apr 23 18:57:28 2011
+++ src/sys/sys/file.h	Sun Apr 24 18:46:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.73 2011/04/23 18:57:28 rmind Exp $	*/
+/*	$NetBSD: file.h,v 1.74 2011/04/24 18:46:24 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,6 @@
 #include <sys/unistd.h>
 
 #ifdef _KERNEL
-#include <sys/mallocvar.h>
 #include <sys/queue.h>
 #include <sys/mutex.h>
 #include <sys/condvar.h>

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.76 src/sys/sys/namei.h:1.77
--- src/sys/sys/namei.h:1.76	Mon Apr 18 00:43:56 2011
+++ src/sys/sys/namei.h	Sun Apr 24 18:46:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.h,v 1.76 2011/04/18 00:43:56 dholland Exp $	*/
+/*	$NetBSD: namei.h,v 1.77 2011/04/24 18:46:24 rmind Exp $	*/
 
 
 /*
@@ -184,7 +184,7 @@
 /*
  * This structure describes the elements in the cache of recent
  * names looked up by namei. NCHNAMLEN is sized to make structure
- * size a power of two to optimize malloc's. Minimum reasonable
+ * size a power of two to optimize allocations.  Minimum reasonable
  * size is 15.
  */
 
@@ -213,7 +213,6 @@
 };
 
 #ifdef _KERNEL
-#include <sys/mallocvar.h>
 #include <sys/pool.h>
 
 struct mount;

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.23 src/sys/sys/namei.src:1.24
--- src/sys/sys/namei.src:1.23	Mon Apr 18 00:40:54 2011
+++ src/sys/sys/namei.src	Sun Apr 24 18:46:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.23 2011/04/18 00:40:54 dholland Exp $	*/
+/*	$NetBSD: namei.src,v 1.24 2011/04/24 18:46:24 rmind Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -176,7 +176,7 @@
 /*
  * This structure describes the elements in the cache of recent
  * names looked up by namei. NCHNAMLEN is sized to make structure
- * size a power of two to optimize malloc's. Minimum reasonable
+ * size a power of two to optimize allocations.  Minimum reasonable
  * size is 15.
  */
 
@@ -205,7 +205,6 @@
 };
 
 #ifdef _KERNEL
-#include <sys/mallocvar.h>
 #include <sys/pool.h>
 
 struct mount;

Reply via email to