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 /sys/nfs | |
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.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_common.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_nqlease.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_subs.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 16 |
5 files changed, 19 insertions, 18 deletions
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; } } |