summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-01 12:49:40 +0000
committerphk <phk@FreeBSD.org>2003-04-01 12:49:40 +0000
commit78929984b35f18549d709e695fda2db9701ed3dd (patch)
treeabbe0472832558e42a4cb01c0f351df073f9ce2f /sys/kern
parent6b0e3863fff577df842abcb6ada5392bb4c889a7 (diff)
downloadFreeBSD-src-78929984b35f18549d709e695fda2db9701ed3dd.zip
FreeBSD-src-78929984b35f18549d709e695fda2db9701ed3dd.tar.gz
Introduce bioq_flush() function.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_disk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 35c2295..475b4d8 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -89,6 +89,21 @@ bioq_remove(struct bio_queue_head *head, struct bio *bp)
if (TAILQ_FIRST(&head->queue) == head->switch_point)
head->switch_point = NULL;
}
+
+void
+bioq_flush(struct bio_queue_head *head, struct devstat *stp, int error)
+{
+ struct bio *bp;
+
+ for (;;) {
+ bp = bioq_first(head);
+ if (bp == NULL)
+ break;
+ bioq_remove(head, bp);
+ biofinish(bp, stp, ENXIO);
+ }
+}
+
void
bioq_insert_tail(struct bio_queue_head *head, struct bio *bp)
{
OpenPOWER on IntegriCloud