From 11f8a0ca772467de4a9bdad194f098900efbcf23 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 18 Apr 2000 13:25:19 +0000 Subject: [PATCH] Retire bufqdisksort(), all drivers use bioqdisksort now. --- sys/kern/subr_disklabel.c | 98 -------------------------------------- sys/sys/disklabel.h | 1 - sys/sys/diskmbr.h | 1 - sys/sys/diskpc98.h | 1 - sys/ufs/ufs/ufs_disksubr.c | 98 -------------------------------------- 5 files changed, 199 deletions(-) diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c index 8a1fc0bea04e..f3f7b981678e 100644 --- a/sys/kern/subr_disklabel.c +++ b/sys/kern/subr_disklabel.c @@ -62,104 +62,6 @@ * allocated. */ -void -bufqdisksort(bufq, bp) - struct buf_queue_head *bufq; - struct buf *bp; -{ - struct buf *bq; - struct buf *bn; - struct buf *be; - - be = TAILQ_LAST(&bufq->queue, buf_queue); - /* - * If the queue is empty or we are an - * ordered transaction, then it's easy. - */ - if ((bq = bufq_first(bufq)) == NULL - || (bp->b_ioflags & BIO_ORDERED) != 0) { - bufq_insert_tail(bufq, bp); - return; - } else if (bufq->insert_point != NULL) { - - /* - * A certain portion of the list is - * "locked" to preserve ordering, so - * we can only insert after the insert - * point. - */ - bq = bufq->insert_point; - } else { - - /* - * If we lie before the last removed (currently active) - * request, and are not inserting ourselves into the - * "locked" portion of the list, then we must add ourselves - * to the second request list. - */ - if (bp->b_pblkno < bufq->last_pblkno) { - - bq = bufq->switch_point; - /* - * If we are starting a new secondary list, - * then it's easy. - */ - if (bq == NULL) { - bufq->switch_point = bp; - bufq_insert_tail(bufq, bp); - return; - } - /* - * If we lie ahead of the current switch point, - * insert us before the switch point and move - * the switch point. - */ - if (bp->b_pblkno < bq->b_pblkno) { - bufq->switch_point = bp; - TAILQ_INSERT_BEFORE(bq, bp, b_act); - return; - } - } else { - if (bufq->switch_point != NULL) - be = TAILQ_PREV(bufq->switch_point, - buf_queue, b_act); - /* - * If we lie between last_pblkno and bq, - * insert before bq. - */ - if (bp->b_pblkno < bq->b_pblkno) { - TAILQ_INSERT_BEFORE(bq, bp, b_act); - return; - } - } - } - - /* - * Request is at/after our current position in the list. - * Optimize for sequential I/O by seeing if we go at the tail. - */ - if (bp->b_pblkno > be->b_pblkno) { - TAILQ_INSERT_AFTER(&bufq->queue, be, bp, b_act); - return; - } - - /* Otherwise, insertion sort */ - while ((bn = TAILQ_NEXT(bq, b_act)) != NULL) { - - /* - * We want to go after the current request if it is the end - * of the first request list, or if the next request is a - * larger cylinder than our request. - */ - if (bn == bufq->switch_point - || bp->b_pblkno < bn->b_pblkno) - break; - bq = bn; - } - TAILQ_INSERT_AFTER(&bufq->queue, bq, bp, b_act); -} - - void bioqdisksort(bioq, bp) struct bio_queue_head *bioq; diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index 507005620ab7..b201add1250a 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -448,7 +448,6 @@ void diskerr __P((struct bio *bp, char *what, int pri, int blkdone, void disksort __P((struct buf *ap, struct buf *bp)); u_int dkcksum __P((struct disklabel *lp)); char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bufqdisksort __P((struct buf_queue_head *ap, struct buf *bp)); void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, u_long openmask)); diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index 507005620ab7..b201add1250a 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -448,7 +448,6 @@ void diskerr __P((struct bio *bp, char *what, int pri, int blkdone, void disksort __P((struct buf *ap, struct buf *bp)); u_int dkcksum __P((struct disklabel *lp)); char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bufqdisksort __P((struct buf_queue_head *ap, struct buf *bp)); void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, u_long openmask)); diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h index 507005620ab7..b201add1250a 100644 --- a/sys/sys/diskpc98.h +++ b/sys/sys/diskpc98.h @@ -448,7 +448,6 @@ void diskerr __P((struct bio *bp, char *what, int pri, int blkdone, void disksort __P((struct buf *ap, struct buf *bp)); u_int dkcksum __P((struct disklabel *lp)); char *readdisklabel __P((dev_t dev, struct disklabel *lp)); -void bufqdisksort __P((struct buf_queue_head *ap, struct buf *bp)); void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp)); int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp, u_long openmask)); diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c index 8a1fc0bea04e..f3f7b981678e 100644 --- a/sys/ufs/ufs/ufs_disksubr.c +++ b/sys/ufs/ufs/ufs_disksubr.c @@ -62,104 +62,6 @@ * allocated. */ -void -bufqdisksort(bufq, bp) - struct buf_queue_head *bufq; - struct buf *bp; -{ - struct buf *bq; - struct buf *bn; - struct buf *be; - - be = TAILQ_LAST(&bufq->queue, buf_queue); - /* - * If the queue is empty or we are an - * ordered transaction, then it's easy. - */ - if ((bq = bufq_first(bufq)) == NULL - || (bp->b_ioflags & BIO_ORDERED) != 0) { - bufq_insert_tail(bufq, bp); - return; - } else if (bufq->insert_point != NULL) { - - /* - * A certain portion of the list is - * "locked" to preserve ordering, so - * we can only insert after the insert - * point. - */ - bq = bufq->insert_point; - } else { - - /* - * If we lie before the last removed (currently active) - * request, and are not inserting ourselves into the - * "locked" portion of the list, then we must add ourselves - * to the second request list. - */ - if (bp->b_pblkno < bufq->last_pblkno) { - - bq = bufq->switch_point; - /* - * If we are starting a new secondary list, - * then it's easy. - */ - if (bq == NULL) { - bufq->switch_point = bp; - bufq_insert_tail(bufq, bp); - return; - } - /* - * If we lie ahead of the current switch point, - * insert us before the switch point and move - * the switch point. - */ - if (bp->b_pblkno < bq->b_pblkno) { - bufq->switch_point = bp; - TAILQ_INSERT_BEFORE(bq, bp, b_act); - return; - } - } else { - if (bufq->switch_point != NULL) - be = TAILQ_PREV(bufq->switch_point, - buf_queue, b_act); - /* - * If we lie between last_pblkno and bq, - * insert before bq. - */ - if (bp->b_pblkno < bq->b_pblkno) { - TAILQ_INSERT_BEFORE(bq, bp, b_act); - return; - } - } - } - - /* - * Request is at/after our current position in the list. - * Optimize for sequential I/O by seeing if we go at the tail. - */ - if (bp->b_pblkno > be->b_pblkno) { - TAILQ_INSERT_AFTER(&bufq->queue, be, bp, b_act); - return; - } - - /* Otherwise, insertion sort */ - while ((bn = TAILQ_NEXT(bq, b_act)) != NULL) { - - /* - * We want to go after the current request if it is the end - * of the first request list, or if the next request is a - * larger cylinder than our request. - */ - if (bn == bufq->switch_point - || bp->b_pblkno < bn->b_pblkno) - break; - bq = bn; - } - TAILQ_INSERT_AFTER(&bufq->queue, bq, bp, b_act); -} - - void bioqdisksort(bioq, bp) struct bio_queue_head *bioq;