Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Expose device type. You can query it with e.g. dr...



details:   https://anonhg.NetBSD.org/src/rev/525eca58f893
branches:  trunk
changeset: 456180:525eca58f893
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Apr 26 14:28:40 2019 +0000

description:
Expose device type. You can query it with e.g. drvctl -p ld0 disk-info/type.

Missing in previous commit.

diffstat:

 sys/dev/ic/ld_nvme.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 8767a379f660 -r 525eca58f893 sys/dev/ic/ld_nvme.c
--- a/sys/dev/ic/ld_nvme.c      Fri Apr 26 11:51:56 2019 +0000
+++ b/sys/dev/ic/ld_nvme.c      Fri Apr 26 14:28:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld_nvme.c,v 1.21 2018/12/01 15:07:58 jdolecek Exp $    */
+/*     $NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $     */
 
 /*-
  * Copyright (C) 2016 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.21 2018/12/01 15:07:58 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.22 2019/04/26 14:28:40 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -113,6 +113,7 @@
        ld->sc_dump = ld_nvme_dump;
        ld->sc_ioctl = ld_nvme_ioctl;
        ld->sc_flags = LDF_ENABLED | LDF_NO_RND | LDF_MPSAFE;
+       ld->sc_typename = kmem_asprintf("%s", naa->naa_typename);
        ldattach(ld, "fcfs");
 }
 
@@ -127,6 +128,8 @@
                return rv;
        ldenddetach(ld);
 
+       kmem_free(ld->sc_typename, strlen(ld->sc_typename) + 1);
+
        nvme_ns_free(sc->sc_nvme, sc->sc_nsid);
 
        return 0;



Home | Main Index | Thread Index | Old Index