Introduce bioq_flush() function.
This commit is contained in:
parent
4d63e8de71
commit
af6ca7f4a9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112941
@ -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)
|
||||
{
|
||||
|
@ -120,6 +120,7 @@ int biowait(struct bio *bp, const char *wchan);
|
||||
void bioq_disksort(struct bio_queue_head *ap, struct bio *bp);
|
||||
#define bioqdisksort(foo, bar) bioq_disksort(foo, bar)
|
||||
struct bio *bioq_first(struct bio_queue_head *head);
|
||||
void bioq_flush(struct bio_queue_head *head, struct devstat *stp, int error);
|
||||
void bioq_init(struct bio_queue_head *head);
|
||||
void bioq_insert_tail(struct bio_queue_head *head, struct bio *bp);
|
||||
void bioq_remove(struct bio_queue_head *head, struct bio *bp);
|
||||
|
Loading…
Reference in New Issue
Block a user