1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Retire bufqdisksort(), all drivers use bioqdisksort now.

This commit is contained in:
Poul-Henning Kamp 2000-04-18 13:25:19 +00:00
parent 0991b97a30
commit 11f8a0ca77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=59363
5 changed files with 0 additions and 199 deletions

View File

@ -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;

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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;