aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>1998-05-06 01:44:12 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>1998-05-06 01:44:12 +0000
commitbd7b49d9bd6dfbc773d95698617551b1993eda53 (patch)
tree0f212913cced4f9f6206e60aa4de4388c3fa865b /sys
parentb2dd53724922eb7fc08e8bbb0693c8606010a3b9 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/bio.h25
-rw-r--r--sys/sys/buf.h25
2 files changed, 14 insertions, 36 deletions
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index 329a4b0b8cdd..c6f05bbd3fd5 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.49 1998/03/19 22:49:01 dyson Exp $
+ * $Id: buf.h,v 1.50 1998/03/28 10:33:21 bde Exp $
*/
#ifndef _SYS_BUF_H_
@@ -165,7 +165,7 @@ struct buf {
#define NOOFFSET (-1LL) /* No buffer offset calculated yet */
typedef struct buf_queue_head {
- TAILQ_HEAD(, buf) queue;
+ TAILQ_HEAD(buf_queue, buf) queue;
struct buf *insert_point;
struct buf *switch_point;
} buf_queue_head, *buf_queue_head_t;
@@ -201,24 +201,13 @@ bufq_insert_tail(buf_queue_head *head, struct buf *bp)
static __inline void
bufq_remove(buf_queue_head *head, struct buf *bp)
{
- if (bp == TAILQ_FIRST(&head->queue)) {
- if (bp == head->insert_point)
- head->insert_point = NULL;
- if (TAILQ_NEXT(bp, b_act) == head->switch_point)
+ 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 {
- if (bp == head->insert_point) {
- /*
- * Not 100% correct (we really want the
- * previous bp), but it will ensure queue
- * ordering and is less expensive than
- * using a CIRCLEQ.
- */
- head->insert_point = TAILQ_NEXT(bp, b_act);
- }
- if (bp == head->switch_point) {
- head->switch_point = TAILQ_NEXT(bp, b_act);
- }
+ head->switch_point = TAILQ_NEXT(bp, b_act);
}
TAILQ_REMOVE(&head->queue, bp, b_act);
}
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 329a4b0b8cdd..c6f05bbd3fd5 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.49 1998/03/19 22:49:01 dyson Exp $
+ * $Id: buf.h,v 1.50 1998/03/28 10:33:21 bde Exp $
*/
#ifndef _SYS_BUF_H_
@@ -165,7 +165,7 @@ struct buf {
#define NOOFFSET (-1LL) /* No buffer offset calculated yet */
typedef struct buf_queue_head {
- TAILQ_HEAD(, buf) queue;
+ TAILQ_HEAD(buf_queue, buf) queue;
struct buf *insert_point;
struct buf *switch_point;
} buf_queue_head, *buf_queue_head_t;
@@ -201,24 +201,13 @@ bufq_insert_tail(buf_queue_head *head, struct buf *bp)
static __inline void
bufq_remove(buf_queue_head *head, struct buf *bp)
{
- if (bp == TAILQ_FIRST(&head->queue)) {
- if (bp == head->insert_point)
- head->insert_point = NULL;
- if (TAILQ_NEXT(bp, b_act) == head->switch_point)
+ 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 {
- if (bp == head->insert_point) {
- /*
- * Not 100% correct (we really want the
- * previous bp), but it will ensure queue
- * ordering and is less expensive than
- * using a CIRCLEQ.
- */
- head->insert_point = TAILQ_NEXT(bp, b_act);
- }
- if (bp == head->switch_point) {
- head->switch_point = TAILQ_NEXT(bp, b_act);
- }
+ head->switch_point = TAILQ_NEXT(bp, b_act);
}
TAILQ_REMOVE(&head->queue, bp, b_act);
}