summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authormarco <marco@openbsd.org>2009-06-03 06:25:27 +0000
committermarco <marco@openbsd.org>2009-06-03 06:25:27 +0000
commit94fc3cc9465a32ebb61a556d0a53e3bd19afccc5 (patch)
tree298c150346d48df4ed5d027d9d705a763bef2b14 /sys/kern/subr_disk.c
parentWhack conflicting BARs, such that they get assigned a non-conflicting value (diff)
downloadwireguard-openbsd-94fc3cc9465a32ebb61a556d0a53e3bd19afccc5.tar.xz
wireguard-openbsd-94fc3cc9465a32ebb61a556d0a53e3bd19afccc5.zip
Add a callback specifically for softraid. If you touch this kittens will
be murdered and theo will visit with a 2x4. ok deraadt
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 4e5e3ba504a..d39c97b8971 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.89 2009/06/03 03:14:28 thib Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.90 2009/06/03 06:25:27 marco Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -77,6 +77,9 @@ int disk_change; /* set if a disk has been attached/detached
* is reset by hw_sysctl()
*/
+/* softraid callback, do not use! */
+void (*softraid_disk_attach)(struct disk *, int);
+
/*
* Seek sort for disks. We depend on the driver which calls us using b_resid
* as the current cylinder number.
@@ -796,6 +799,9 @@ disk_attach(struct disk *diskp)
TAILQ_INSERT_TAIL(&disklist, diskp, dk_link);
++disk_count;
disk_change = 1;
+
+ if (softraid_disk_attach)
+ softraid_disk_attach(diskp, 1);
}
/*
@@ -805,6 +811,9 @@ void
disk_detach(struct disk *diskp)
{
+ if (softraid_disk_attach)
+ softraid_disk_attach(diskp, -1);
+
/*
* Free the space used by the disklabel structures.
*/