diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-12-26 21:22:15 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-12-26 21:22:15 +0000 |
commit | c5af0812e5d7d60d182addc4594c42baf2e8b591 (patch) | |
tree | f3b7e8064fa2dac88f6df9c7c5bda683a4ee96fe /sys/kern/vfs_bio.c | |
parent | fa70810cdbb843b66175fff83a47dc871a8c2780 (diff) |
Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 63ccd7eab52..ae1c7300bb5 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.74 2004/12/11 14:26:31 pedro Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.75 2004/12/26 21:22:13 miod Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /*- @@ -143,9 +143,9 @@ bremfree(struct buf *bp) * * NB: This makes an assumption about how tailq's are implemented. */ - if (bp->b_freelist.tqe_next == NULL) { + if (TAILQ_NEXT(bp, b_freelist) == NULL) { for (dp = bufqueues; dp < &bufqueues[BQUEUES]; dp++) - if (dp->tqh_last == &bp->b_freelist.tqe_next) + if (dp->tqh_last == &TAILQ_NEXT(bp, b_freelist)) break; if (dp == &bufqueues[BQUEUES]) panic("bremfree: lost tail"); @@ -739,7 +739,7 @@ allocbuf(struct buf *bp, int size) */ if (bp->b_bufsize > desired_size) { s = splbio(); - if ((nbp = bufqueues[BQ_EMPTY].tqh_first) == NULL) { + if ((nbp = TAILQ_FIRST(&bufqueues[BQ_EMPTY])) == NULL) { /* No free buffer head */ splx(s); goto out; @@ -1009,7 +1009,7 @@ vfs_bufstats() pages = 0; for (j = 0; j <= MAXBSIZE/PAGE_SIZE; j++) counts[j] = 0; - for (bp = dp->tqh_first; bp; bp = bp->b_freelist.tqe_next) { + TAILQ_FOREACH(bp, dp, b_freelist) { counts[bp->b_bufsize/PAGE_SIZE]++; count++; pages += btoc(bp->b_bufsize); |