aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-04-01 12:49:40 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-04-01 12:49:40 +0000
commitaf6ca7f4a9044e82b876ad1ec5f1d52113c981ba (patch)
treeabbe0472832558e42a4cb01c0f351df073f9ce2f /sys/kern/subr_disk.c
parent4d63e8de710bbe23ce7d39bb0b039be27a72f508 (diff)
downloadsrc-af6ca7f4a9044e82b876ad1ec5f1d52113c981ba.tar.gz
src-af6ca7f4a9044e82b876ad1ec5f1d52113c981ba.zip
Introduce bioq_flush() function.
Notes
Notes: svn path=/head/; revision=112941
Diffstat (limited to 'sys/kern/subr_disk.c')
-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 35c2295b745e..475b4d873d3a 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)
{