| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: subr_autoconf.c,v 1.191 2010/01/05 22:42:16 dyoung Exp $ */ | | 1 | /* $NetBSD: subr_autoconf.c,v 1.192 2010/01/07 22:39:52 dyoung Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996, 2000 Christopher G. Demetriou | | 4 | * Copyright (c) 1996, 2000 Christopher G. Demetriou |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -67,27 +67,27 @@ | | | @@ -67,27 +67,27 @@ |
67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
72 | * SUCH DAMAGE. | | 72 | * SUCH DAMAGE. |
73 | * | | 73 | * |
74 | * from: Header: subr_autoconf.c,v 1.12 93/02/01 19:31:48 torek Exp (LBL) | | 74 | * from: Header: subr_autoconf.c,v 1.12 93/02/01 19:31:48 torek Exp (LBL) |
75 | * | | 75 | * |
76 | * @(#)subr_autoconf.c 8.3 (Berkeley) 5/17/94 | | 76 | * @(#)subr_autoconf.c 8.3 (Berkeley) 5/17/94 |
77 | */ | | 77 | */ |
78 | | | 78 | |
79 | #include <sys/cdefs.h> | | 79 | #include <sys/cdefs.h> |
80 | __KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.191 2010/01/05 22:42:16 dyoung Exp $"); | | 80 | __KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.192 2010/01/07 22:39:52 dyoung Exp $"); |
81 | | | 81 | |
82 | #ifdef _KERNEL_OPT | | 82 | #ifdef _KERNEL_OPT |
83 | #include "opt_ddb.h" | | 83 | #include "opt_ddb.h" |
84 | #endif | | 84 | #endif |
85 | | | 85 | |
86 | #include <sys/param.h> | | 86 | #include <sys/param.h> |
87 | #include <sys/device.h> | | 87 | #include <sys/device.h> |
88 | #include <sys/disklabel.h> | | 88 | #include <sys/disklabel.h> |
89 | #include <sys/conf.h> | | 89 | #include <sys/conf.h> |
90 | #include <sys/kauth.h> | | 90 | #include <sys/kauth.h> |
91 | #include <sys/malloc.h> | | 91 | #include <sys/malloc.h> |
92 | #include <sys/kmem.h> | | 92 | #include <sys/kmem.h> |
93 | #include <sys/systm.h> | | 93 | #include <sys/systm.h> |
| @@ -2712,26 +2712,32 @@ deviter_release(deviter_t *di) | | | @@ -2712,26 +2712,32 @@ deviter_release(deviter_t *di) |
2712 | { | | 2712 | { |
2713 | bool rw = (di->di_flags & DEVITER_F_RW) != 0; | | 2713 | bool rw = (di->di_flags & DEVITER_F_RW) != 0; |
2714 | int s; | | 2714 | int s; |
2715 | | | 2715 | |
2716 | s = config_alldevs_lock(); | | 2716 | s = config_alldevs_lock(); |
2717 | if (rw) | | 2717 | if (rw) |
2718 | --alldevs_nwrite; | | 2718 | --alldevs_nwrite; |
2719 | else | | 2719 | else |
2720 | --alldevs_nread; | | 2720 | --alldevs_nread; |
2721 | /* XXX wake a garbage-collection thread */ | | 2721 | /* XXX wake a garbage-collection thread */ |
2722 | config_alldevs_unlock(s); | | 2722 | config_alldevs_unlock(s); |
2723 | } | | 2723 | } |
2724 | | | 2724 | |
| | | 2725 | void |
| | | 2726 | null_childdetached(device_t self, device_t child) |
| | | 2727 | { |
| | | 2728 | /* do nothing */ |
| | | 2729 | } |
| | | 2730 | |
2725 | static void | | 2731 | static void |
2726 | sysctl_detach_setup(struct sysctllog **clog) | | 2732 | sysctl_detach_setup(struct sysctllog **clog) |
2727 | { | | 2733 | { |
2728 | const struct sysctlnode *node = NULL; | | 2734 | const struct sysctlnode *node = NULL; |
2729 | | | 2735 | |
2730 | sysctl_createv(clog, 0, NULL, &node, | | 2736 | sysctl_createv(clog, 0, NULL, &node, |
2731 | CTLFLAG_PERMANENT, | | 2737 | CTLFLAG_PERMANENT, |
2732 | CTLTYPE_NODE, "kern", NULL, | | 2738 | CTLTYPE_NODE, "kern", NULL, |
2733 | NULL, 0, NULL, 0, | | 2739 | NULL, 0, NULL, 0, |
2734 | CTL_KERN, CTL_EOL); | | 2740 | CTL_KERN, CTL_EOL); |
2735 | | | 2741 | |
2736 | if (node == NULL) | | 2742 | if (node == NULL) |
2737 | return; | | 2743 | return; |