diff options
author | gibbs <gibbs@FreeBSD.org> | 1998-05-13 16:03:33 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1998-05-13 16:03:33 +0000 |
commit | b7cd4ac3071bfafd239b9fc6450b2a331a18b5b6 (patch) | |
tree | d06bcb5cc2e2e65959ca6f868f7482b3f7ef39d5 | |
parent | 9f6900bbcdc03cacf3ec9a92f0824e8a861d3fbc (diff) | |
download | FreeBSD-src-b7cd4ac3071bfafd239b9fc6450b2a331a18b5b6.zip FreeBSD-src-b7cd4ac3071bfafd239b9fc6450b2a331a18b5b6.tar.gz |
Fix bogus "cleanup" in bufq_remove. The "switch point" for tqdisksort was
getting mangled.
Submitted by: Bruce Evans <bde@zeta.org.au>
-rw-r--r-- | sys/sys/bio.h | 12 | ||||
-rw-r--r-- | sys/sys/buf.h | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/sys/sys/bio.h b/sys/sys/bio.h index c6f05bb..91ca187 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.9 (Berkeley) 3/30/95 - * $Id: buf.h,v 1.50 1998/03/28 10:33:21 bde Exp $ + * $Id: buf.h,v 1.51 1998/05/06 01:44:12 gibbs Exp $ */ #ifndef _SYS_BUF_H_ @@ -203,13 +203,11 @@ bufq_remove(buf_queue_head *head, struct buf *bp) { if (bp == head->insert_point) head->insert_point = TAILQ_PREV(bp, buf_queue, b_act); - if (bp == head->switch_point) { - if (bp == TAILQ_FIRST(&head->queue)) - head->switch_point = NULL; - } else { - head->switch_point = TAILQ_NEXT(bp, b_act); - } + if (bp == head->switch_point) + head->switch_point = TAILQ_NEXT(bp, b_act); TAILQ_REMOVE(&head->queue, bp, b_act); + if (TAILQ_FIRST(&head->queue) == head->switch_point) + head->switch_point = NULL; } static __inline struct buf * diff --git a/sys/sys/buf.h b/sys/sys/buf.h index c6f05bb..91ca187 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.9 (Berkeley) 3/30/95 - * $Id: buf.h,v 1.50 1998/03/28 10:33:21 bde Exp $ + * $Id: buf.h,v 1.51 1998/05/06 01:44:12 gibbs Exp $ */ #ifndef _SYS_BUF_H_ @@ -203,13 +203,11 @@ bufq_remove(buf_queue_head *head, struct buf *bp) { if (bp == head->insert_point) head->insert_point = TAILQ_PREV(bp, buf_queue, b_act); - if (bp == head->switch_point) { - if (bp == TAILQ_FIRST(&head->queue)) - head->switch_point = NULL; - } else { - head->switch_point = TAILQ_NEXT(bp, b_act); - } + if (bp == head->switch_point) + head->switch_point = TAILQ_NEXT(bp, b_act); TAILQ_REMOVE(&head->queue, bp, b_act); + if (TAILQ_FIRST(&head->queue) == head->switch_point) + head->switch_point = NULL; } static __inline struct buf * |