Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi sd(4): Use d_cfdriver/devtounit to avoid open...



details:   https://anonhg.NetBSD.org/src/rev/2446c6990afb
branches:  trunk
changeset: 364530:2446c6990afb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 28 12:39:46 2022 +0000

description:
sd(4): Use d_cfdriver/devtounit to avoid open/detach races.

diffstat:

 sys/dev/scsipi/sd.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r fc4bb157875e -r 2446c6990afb sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Mon Mar 28 12:39:37 2022 +0000
+++ b/sys/dev/scsipi/sd.c       Mon Mar 28 12:39:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.333 2022/01/27 18:44:49 jakllsch Exp $        */
+/*     $NetBSD: sd.c,v 1.334 2022/03/28 12:39:46 riastradh Exp $       */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.333 2022/01/27 18:44:49 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.334 2022/03/28 12:39:46 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -167,6 +167,8 @@
        .d_dump = sddump,
        .d_psize = sdsize,
        .d_discard = nodiscard,
+       .d_cfdriver = &sd_cd,
+       .d_devtounit = disklabel_dev_unit,
        .d_flag = D_DISK | D_MPSAFE
 };
 
@@ -182,6 +184,8 @@
        .d_mmap = nommap,
        .d_kqfilter = nokqfilter,
        .d_discard = nodiscard,
+       .d_cfdriver = &sd_cd,
+       .d_devtounit = disklabel_dev_unit,
        .d_flag = D_DISK | D_MPSAFE
 };
 



Home | Main Index | Thread Index | Old Index