summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/bio.c18
-rw-r--r--sys/dev/biovar.h3
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/bio.c b/sys/dev/bio.c
index 5e2af3e1527..4e38d1a1aa1 100644
--- a/sys/dev/bio.c
+++ b/sys/dev/bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bio.c,v 1.5 2005/08/08 04:02:30 deraadt Exp $ */
+/* $OpenBSD: bio.c,v 1.6 2005/08/17 02:32:23 dlg Exp $ */
/*
* Copyright (c) 2002 Niklas Hallqvist. All rights reserved.
@@ -131,6 +131,22 @@ bio_register(dev, ioctl)
return (0);
}
+void
+bio_unregister(dev)
+ struct device *dev;
+{
+ struct bio_mapping *bm, *next;
+
+ for (bm = LIST_FIRST(&bios); bm != NULL; bm = next) {
+ next = LIST_NEXT(bm, bm_link);
+
+ if (dev == bm->bm_dev) {
+ LIST_REMOVE(bm, bm_link);
+ free(bm, M_DEVBUF);
+ }
+ }
+}
+
struct bio_mapping *
bio_lookup(name)
char *name;
diff --git a/sys/dev/biovar.h b/sys/dev/biovar.h
index e580cbc7831..85187fe54b6 100644
--- a/sys/dev/biovar.h
+++ b/sys/dev/biovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biovar.h,v 1.14 2005/08/16 01:12:46 marco Exp $ */
+/* $OpenBSD: biovar.h,v 1.15 2005/08/17 02:32:23 dlg Exp $ */
/*
* Copyright (c) 2002 Niklas Hallqvist. All rights reserved.
@@ -47,6 +47,7 @@ struct bio_locate {
#ifdef _KERNEL
int bio_register(struct device *, int (*)(struct device *, u_long,
caddr_t));
+void bio_unregister(struct device *);
#endif
/* RAID section */