Module Name: src Committed By: riastradh Date: Mon Mar 28 12:39:37 UTC 2022
Modified Files: src/sys/dev/ata: wd.c Log Message: wd(4): Use d_cfdriver/devtounit to avoid open/detach races. To generate a diff of this commit: cvs rdiff -u -r1.466 -r1.467 src/sys/dev/ata/wd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ata/wd.c diff -u src/sys/dev/ata/wd.c:1.466 src/sys/dev/ata/wd.c:1.467 --- src/sys/dev/ata/wd.c:1.466 Tue Dec 28 13:27:32 2021 +++ src/sys/dev/ata/wd.c Mon Mar 28 12:39:37 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.466 2021/12/28 13:27:32 riastradh Exp $ */ +/* $NetBSD: wd.c,v 1.467 2022/03/28 12:39:37 riastradh Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.466 2021/12/28 13:27:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.467 2022/03/28 12:39:37 riastradh Exp $"); #include "opt_ata.h" #include "opt_wd.h" @@ -152,6 +152,8 @@ const struct bdevsw wd_bdevsw = { .d_dump = wddump, .d_psize = wdsize, .d_discard = wddiscard, + .d_cfdriver = &wd_cd, + .d_devtounit = disklabel_dev_unit, .d_flag = D_DISK }; @@ -167,6 +169,8 @@ const struct cdevsw wd_cdevsw = { .d_mmap = nommap, .d_kqfilter = nokqfilter, .d_discard = wddiscard, + .d_cfdriver = &wd_cd, + .d_devtounit = disklabel_dev_unit, .d_flag = D_DISK };