From 78929984b35f18549d709e695fda2db9701ed3dd Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 1 Apr 2003 12:49:40 +0000 Subject: Introduce bioq_flush() function. --- sys/kern/subr_disk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sys/kern') 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) { -- cgit v1.1