diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2009-06-03 06:25:28 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2009-06-03 06:25:28 +0000 |
commit | 2a4af8a740536641883ef73c7720d6a949cc119d (patch) | |
tree | 5ee7f7c14ea8b617ff50cdb3b3def10500019681 /sys/kern | |
parent | e23853693cbfa8b010baaa91e76b935af372ce86 (diff) |
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')
-rw-r--r-- | sys/kern/subr_disk.c | 11 |
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. */ |