Source-Changes-HG archive

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

[src/trunk]: src/sys/dev malloc(9) -> kmem(9)



details:   https://anonhg.NetBSD.org/src/rev/80fd8ab1bde1
branches:  trunk
changeset: 957955:80fd8ab1bde1
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Dec 19 01:12:21 2020 +0000

description:
malloc(9) -> kmem(9)

diffstat:

 sys/dev/bio.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r af191dbb25f3 -r 80fd8ab1bde1 sys/dev/bio.c
--- a/sys/dev/bio.c     Sat Dec 19 00:27:34 2020 +0000
+++ b/sys/dev/bio.c     Sat Dec 19 01:12:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bio.c,v 1.16 2019/11/10 21:16:34 chs Exp $ */
+/*     $NetBSD: bio.c,v 1.17 2020/12/19 01:12:21 thorpej Exp $ */
 /*     $OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $   */
 
 /*
@@ -28,7 +28,7 @@
 /* A device controller ioctl tunnelling device.  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bio.c,v 1.16 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bio.c,v 1.17 2020/12/19 01:12:21 thorpej Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -37,7 +37,7 @@
 #include <sys/device.h>
 #include <sys/event.h>
 #include <sys/ioctl.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/queue.h>
 #include <sys/systm.h>
 #include <sys/mutex.h>
@@ -208,7 +208,7 @@
        if (!bio_lock_initialized)
                bio_initialize();
 
-       bm = malloc(sizeof(*bm), M_DEVBUF, M_WAITOK|M_ZERO);
+       bm = kmem_zalloc(sizeof(*bm), KM_SLEEP);
        bm->bm_dev = dev;
        bm->bm_ioctl = ioctl;
        mutex_enter(&bio_lock);
@@ -228,7 +228,7 @@
 
                if (dev == bm->bm_dev) {
                        LIST_REMOVE(bm, bm_link);
-                       free(bm, M_DEVBUF);
+                       kmem_free(bm, sizeof(*bm));
                }
        }
        mutex_exit(&bio_lock);



Home | Main Index | Thread Index | Old Index