diff options
author | peter <peter@FreeBSD.org> | 1998-10-31 15:31:29 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-10-31 15:31:29 +0000 |
commit | 8ef35acf90b37c2fc5b567eccaa3778f363d41a0 (patch) | |
tree | 1f2cdd6ce7e2fb30893bb1cea70630fd7c6edb14 | |
parent | b7f6f55ecf024f827ab5fb630a1826c0133aab0a (diff) | |
download | FreeBSD-src-8ef35acf90b37c2fc5b567eccaa3778f363d41a0.zip FreeBSD-src-8ef35acf90b37c2fc5b567eccaa3778f363d41a0.tar.gz |
Use TAILQ macros for clean/dirty block list processing. Set b_xflags
rather than abusing the list next pointer with a magic number.
29 files changed, 94 insertions, 96 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index cf8f905..02ed050 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.36 1998/09/07 13:17:02 bde Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.37 1998/10/25 19:26:18 bde Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -797,8 +797,8 @@ msdosfs_unmount(mp, mntflags, p) vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev, vp->v_mount); printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n", - vp->v_cleanblkhd.lh_first, - vp->v_dirtyblkhd.lh_first, + TAILQ_FIRST(&vp->v_cleanblkhd), + TAILQ_FIRST(&vp->v_dirtyblkhd), vp->v_numoutput, vp->v_type); printf("union %p, tag %d, data[0] %08x, data[1] %08x\n", vp->v_socket, vp->v_tag, @@ -913,8 +913,7 @@ loop: if (vp->v_type == VNON || (dep->de_flag & (DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 && - (vp->v_dirtyblkhd.lh_first == NULL || - waitfor == MNT_LAZY)) { + (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) { simple_unlock(&vp->v_interlock); continue; } diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index c892360..f68e1bb 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.75 1998/07/11 07:45:50 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.76 1998/09/13 15:39:01 dt Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -835,8 +835,8 @@ msdosfs_fsync(ap) */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -852,7 +852,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0); } #ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("msdosfs_fsync: dirty", vp); goto loop; } diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 1f8e012..83f77e8 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.74 1998/09/12 20:21:54 phk Exp $ + * $Id: spec_vnops.c,v 1.75 1998/10/26 08:53:13 bde Exp $ */ #include <sys/param.h> @@ -476,8 +476,8 @@ spec_fsync(ap) */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -499,7 +499,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0); } #ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("spec_fsync: dirty", vp); splx(s); goto loop; diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c index 933d031..02f4a62 100644 --- a/sys/gnu/ext2fs/ext2_inode.c +++ b/sys/gnu/ext2fs/ext2_inode.c @@ -349,8 +349,8 @@ done: for (i = 0; i < NDADDR; i++) if (newblks[i] != oip->i_db[i]) panic("itrunc2"); - if (length == 0 && - (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first)) + if (length == 0 && (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) || + !TAILQ_EMPTY(&ovp->v_cleanblkhd))) panic("itrunc3"); #endif /* DIAGNOSTIC */ /* diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index ef80d74..446ef3b 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -919,8 +919,7 @@ loop: if (vp->v_type == VNON || (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && - (vp->v_dirtyblkhd.lh_first == NULL || - waitfor == MNT_LAZY)) { + (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) { simple_unlock(&vp->v_interlock); continue; } diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 07e94b8..8b7ac7d 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -197,8 +197,8 @@ ext2_fsync(ap) loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -222,7 +222,7 @@ loop: tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0); } #if DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("ext2_fsync: dirty", vp); goto loop; } diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c index 933d031..02f4a62 100644 --- a/sys/gnu/fs/ext2fs/ext2_inode.c +++ b/sys/gnu/fs/ext2fs/ext2_inode.c @@ -349,8 +349,8 @@ done: for (i = 0; i < NDADDR; i++) if (newblks[i] != oip->i_db[i]) panic("itrunc2"); - if (length == 0 && - (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first)) + if (length == 0 && (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) || + !TAILQ_EMPTY(&ovp->v_cleanblkhd))) panic("itrunc3"); #endif /* DIAGNOSTIC */ /* diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index ef80d74..446ef3b 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -919,8 +919,7 @@ loop: if (vp->v_type == VNON || (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0 && - (vp->v_dirtyblkhd.lh_first == NULL || - waitfor == MNT_LAZY)) { + (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) { simple_unlock(&vp->v_interlock); continue; } diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 07e94b8..8b7ac7d 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -197,8 +197,8 @@ ext2_fsync(ap) loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -222,7 +222,7 @@ loop: tsleep(&vp->v_numoutput, PRIBIO + 1, "e2fsyn", 0); } #if DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("ext2_fsync: dirty", vp); goto loop; } diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6acb541..0b5487c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -11,7 +11,7 @@ * 2. Absolutely no warranty of function or purpose is made by the author * John S. Dyson. * - * $Id: vfs_bio.c,v 1.182 1998/10/29 11:04:22 dg Exp $ + * $Id: vfs_bio.c,v 1.183 1998/10/30 14:53:54 dg Exp $ */ /* @@ -179,7 +179,7 @@ bufinit() bp->b_rcred = NOCRED; bp->b_wcred = NOCRED; bp->b_qindex = QUEUE_EMPTY; - bp->b_vnbufs.le_next = NOLIST; + bp->b_xflags = 0; LIST_INIT(&bp->b_dep); TAILQ_INSERT_TAIL(&bufqueues[QUEUE_EMPTY], bp, b_freelist); LIST_INSERT_HEAD(&invalhash, bp, b_hash); @@ -421,7 +421,7 @@ bwrite(struct buf * bp) return (0); } -__inline void +void vfs_bio_need_satisfy(void) { ++numfreebuffers; if (!needsbuffer) diff --git a/sys/miscfs/devfs/devfs_vfsops.c b/sys/miscfs/devfs/devfs_vfsops.c index f275170..0229dd0 100644 --- a/sys/miscfs/devfs/devfs_vfsops.c +++ b/sys/miscfs/devfs/devfs_vfsops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vfsops.c,v 1.32 1998/09/07 13:17:00 bde Exp $ + * $Id: devfs_vfsops.c,v 1.33 1998/09/08 16:59:37 bde Exp $ * */ @@ -282,7 +282,7 @@ loop: nvp = vp->v_mntvnodes.le_next; if (VOP_ISLOCKED(vp)) continue; - if ( vp->v_dirtyblkhd.lh_first == NULL) + if (TAILQ_EMPTY(&vp->v_dirtyblkhd)) continue; if (vp->v_type == VBLK) { if (vget(vp, LK_EXCLUSIVE, p)) diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c index 213a867..e694a09 100644 --- a/sys/miscfs/devfs/devfs_vnops.c +++ b/sys/miscfs/devfs/devfs_vnops.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: devfs_vnops.c,v 1.60 1998/09/04 08:06:56 dfr Exp $ + * $Id: devfs_vnops.c,v 1.61 1998/09/30 20:33:46 sos Exp $ */ @@ -1655,8 +1655,8 @@ devfs_fsync(struct vop_fsync_args *ap) */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -1678,7 +1678,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0); } #ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("devfs_fsync: dirty", vp); splx(s); goto loop; diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 1f8e012..83f77e8 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)spec_vnops.c 8.14 (Berkeley) 5/21/95 - * $Id: spec_vnops.c,v 1.74 1998/09/12 20:21:54 phk Exp $ + * $Id: spec_vnops.c,v 1.75 1998/10/26 08:53:13 bde Exp $ */ #include <sys/param.h> @@ -476,8 +476,8 @@ spec_fsync(ap) */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -499,7 +499,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "spfsyn", 0); } #ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("spec_fsync: dirty", vp); splx(s); goto loop; diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index cf8f905..02ed050 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.36 1998/09/07 13:17:02 bde Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.37 1998/10/25 19:26:18 bde Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -797,8 +797,8 @@ msdosfs_unmount(mp, mntflags, p) vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev, vp->v_mount); printf("cleanblkhd %p, dirtyblkhd %p, numoutput %ld, type %d\n", - vp->v_cleanblkhd.lh_first, - vp->v_dirtyblkhd.lh_first, + TAILQ_FIRST(&vp->v_cleanblkhd), + TAILQ_FIRST(&vp->v_dirtyblkhd), vp->v_numoutput, vp->v_type); printf("union %p, tag %d, data[0] %08x, data[1] %08x\n", vp->v_socket, vp->v_tag, @@ -913,8 +913,7 @@ loop: if (vp->v_type == VNON || (dep->de_flag & (DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0 && - (vp->v_dirtyblkhd.lh_first == NULL || - waitfor == MNT_LAZY)) { + (TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY)) { simple_unlock(&vp->v_interlock); continue; } diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index c892360..f68e1bb 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vnops.c,v 1.75 1998/07/11 07:45:50 bde Exp $ */ +/* $Id: msdosfs_vnops.c,v 1.76 1998/09/13 15:39:01 dt Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -835,8 +835,8 @@ msdosfs_fsync(ap) */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & B_BUSY)) continue; if ((bp->b_flags & B_DELWRI) == 0) @@ -852,7 +852,7 @@ loop: (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0); } #ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("msdosfs_fsync: dirty", vp); goto loop; } diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 346e9e6..0e964cb 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 - * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $ + * $Id: nfs_subs.c,v 1.65 1998/09/07 05:42:15 bde Exp $ */ /* @@ -2129,8 +2129,8 @@ loop: if (vp->v_mount != mp) /* Paranoia */ goto loop; nvp = vp->v_mntvnodes.le_next; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bp->b_flags &= ~B_NEEDCOMMIT; diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c index a9464dc..ae6a14a 100644 --- a/sys/nfs/nfs_nqlease.c +++ b/sys/nfs/nfs_nqlease.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_nqlease.c 8.9 (Berkeley) 5/20/95 - * $Id: nfs_nqlease.c,v 1.37 1998/05/31 20:08:52 peter Exp $ + * $Id: nfs_nqlease.c,v 1.38 1998/09/05 15:17:33 bde Exp $ */ @@ -1117,7 +1117,8 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p) } } else if ((np->n_expiry - NQ_RENEWAL) < time_second) { if ((np->n_flag & (NQNFSWRITE | NQNFSNONCACHE)) - == NQNFSWRITE && vp->v_dirtyblkhd.lh_first && + == NQNFSWRITE && + !TAILQ_EMPTY(&vp->v_dirtyblkhd) && vget(vp, LK_EXCLUSIVE, p) == 0) { nmp->nm_inprog = vp; if (vpid == vp->v_id && diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 346e9e6..0e964cb 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 - * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $ + * $Id: nfs_subs.c,v 1.65 1998/09/07 05:42:15 bde Exp $ */ /* @@ -2129,8 +2129,8 @@ loop: if (vp->v_mount != mp) /* Paranoia */ goto loop; nvp = vp->v_mntvnodes.le_next; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bp->b_flags &= ~B_NEEDCOMMIT; diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 23e30c0..eb379b5 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.76 1998/09/07 13:17:05 bde Exp $ + * $Id: nfs_vfsops.c,v 1.77 1998/09/29 23:15:53 mckusick Exp $ */ #include <sys/param.h> @@ -1066,7 +1066,7 @@ loop: */ if (vp->v_mount != mp) goto loop; - if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL || + if (VOP_ISLOCKED(vp) || TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY) continue; if (vget(vp, LK_EXCLUSIVE, p)) diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index e4917c1..67b107e 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.108 1998/09/29 23:29:48 mckusick Exp $ + * $Id: nfs_vnops.c,v 1.109 1998/09/29 23:39:37 mckusick Exp $ */ @@ -2755,8 +2755,8 @@ again: * Count up how many buffers waiting for a commit. */ bveccount = 0; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bveccount++; @@ -2782,8 +2782,8 @@ again: bvec = bvec_on_stack; bvecsize = NFS_COMMITBVECSIZ; } - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if (bvecpos >= bvecsize) break; if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) @@ -2880,8 +2880,8 @@ again: */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if (bp->b_flags & B_BUSY) { if (waitfor != MNT_WAIT || passone) continue; @@ -2935,7 +2935,7 @@ loop: } } } - if (vp->v_dirtyblkhd.lh_first && commit) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) && commit) { goto loop; } } diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 346e9e6..0e964cb 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 - * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $ + * $Id: nfs_subs.c,v 1.65 1998/09/07 05:42:15 bde Exp $ */ /* @@ -2129,8 +2129,8 @@ loop: if (vp->v_mount != mp) /* Paranoia */ goto loop; nvp = vp->v_mntvnodes.le_next; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bp->b_flags &= ~B_NEEDCOMMIT; diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 23e30c0..eb379b5 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 - * $Id: nfs_vfsops.c,v 1.76 1998/09/07 13:17:05 bde Exp $ + * $Id: nfs_vfsops.c,v 1.77 1998/09/29 23:15:53 mckusick Exp $ */ #include <sys/param.h> @@ -1066,7 +1066,7 @@ loop: */ if (vp->v_mount != mp) goto loop; - if (VOP_ISLOCKED(vp) || vp->v_dirtyblkhd.lh_first == NULL || + if (VOP_ISLOCKED(vp) || TAILQ_EMPTY(&vp->v_dirtyblkhd) || waitfor == MNT_LAZY) continue; if (vget(vp, LK_EXCLUSIVE, p)) diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index e4917c1..67b107e 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.108 1998/09/29 23:29:48 mckusick Exp $ + * $Id: nfs_vnops.c,v 1.109 1998/09/29 23:39:37 mckusick Exp $ */ @@ -2755,8 +2755,8 @@ again: * Count up how many buffers waiting for a commit. */ bveccount = 0; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bveccount++; @@ -2782,8 +2782,8 @@ again: bvec = bvec_on_stack; bvecsize = NFS_COMMITBVECSIZ; } - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if (bvecpos >= bvecsize) break; if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) @@ -2880,8 +2880,8 @@ again: */ loop: s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if (bp->b_flags & B_BUSY) { if (waitfor != MNT_WAIT || passone) continue; @@ -2935,7 +2935,7 @@ loop: } } } - if (vp->v_dirtyblkhd.lh_first && commit) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd) && commit) { goto loop; } } diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 346e9e6..0e964cb 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 - * $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $ + * $Id: nfs_subs.c,v 1.65 1998/09/07 05:42:15 bde Exp $ */ /* @@ -2129,8 +2129,8 @@ loop: if (vp->v_mount != mp) /* Paranoia */ goto loop; nvp = vp->v_mntvnodes.le_next; - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); if ((bp->b_flags & (B_BUSY | B_DELWRI | B_NEEDCOMMIT)) == (B_DELWRI | B_NEEDCOMMIT)) bp->b_flags &= ~B_NEEDCOMMIT; diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 353bcd8..5a75ed3 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95 - * $Id: ffs_inode.c,v 1.47 1998/09/15 14:45:28 luoqi Exp $ + * $Id: ffs_inode.c,v 1.48 1998/10/25 17:44:57 phk Exp $ */ #include "opt_quota.h" @@ -387,7 +387,8 @@ done: if (newblks[i] != oip->i_db[i]) panic("ffs_truncate2"); if (length == 0 && - (ovp->v_dirtyblkhd.lh_first || ovp->v_cleanblkhd.lh_first)) + (!TAILQ_EMPTY(&ovp->v_dirtyblkhd) || + !TAILQ_EMPTY(&ovp->v_cleanblkhd))) panic("ffs_truncate3"); #endif /* DIAGNOSTIC */ /* diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0e640c0..073332d 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 - * $Id: ffs_vfsops.c,v 1.90 1998/10/25 19:02:48 bde Exp $ + * $Id: ffs_vfsops.c,v 1.91 1998/10/27 11:47:08 bde Exp $ */ #include "opt_quota.h" @@ -972,7 +972,7 @@ loop: ip = VTOI(vp); if ((vp->v_type == VNON) || ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) && - ((vp->v_dirtyblkhd.lh_first == NULL) || (waitfor == MNT_LAZY))) { + (TAILQ_EMPTY(&vp->v_dirtyblkhd) || (waitfor == MNT_LAZY))) { simple_unlock(&vp->v_interlock); continue; } diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 093c625..b14cd68 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95 - * $Id: ffs_vnops.c,v 1.51 1998/09/07 11:50:19 bde Exp $ + * $Id: ffs_vnops.c,v 1.52 1998/09/24 15:02:46 luoqi Exp $ */ #include <sys/param.h> @@ -146,8 +146,8 @@ ffs_fsync(ap) loop: s = splbio(); loop2: - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; + for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { + nbp = TAILQ_NEXT(bp, b_vnbufs); /* * First time through on a synchronous call, * or if it's already scheduled, skip to the next @@ -228,7 +228,7 @@ loop2: return (error); s = splbio(); - if (vp->v_dirtyblkhd.lh_first) { + if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { /* * Block devices associated with filesystems may * have new I/O requests posted for them even if diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 6c58e0f..bd470dc 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -39,7 +39,7 @@ * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 - * $Id: swap_pager.c,v 1.101 1998/09/04 08:06:56 dfr Exp $ + * $Id: swap_pager.c,v 1.102 1998/10/13 08:24:42 dg Exp $ */ /* @@ -1382,7 +1382,7 @@ swap_pager_putpages(object, m, count, sync, rtvals) bp = spc->spc_bp; bzero(bp, sizeof *bp); bp->b_spc = spc; - bp->b_vnbufs.le_next = NOLIST; + bp->b_xflags = 0; bp->b_data = (caddr_t) kva; } else { spc = NULL; diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 21267e0..c0b5f59 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pager.c,v 1.37 1998/03/16 01:56:01 dyson Exp $ + * $Id: vm_pager.c,v 1.38 1998/10/13 08:24:44 dg Exp $ */ /* @@ -213,7 +213,7 @@ vm_pager_bufferinit() for (i = 0; i < nswbuf; i++, bp++) { TAILQ_INSERT_HEAD(&bswlist, bp, b_freelist); bp->b_rcred = bp->b_wcred = NOCRED; - bp->b_vnbufs.le_next = NOLIST; + bp->b_xflags = 0; } swapbkva = kmem_alloc_pageable(pager_map, nswbuf * MAXPHYS); @@ -336,7 +336,7 @@ initpbuf(struct buf *bp) { bp->b_data = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva; bp->b_kvabase = bp->b_data; bp->b_kvasize = MAXPHYS; - bp->b_vnbufs.le_next = NOLIST; + bp->b_xflags = 0; } /* |