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/ufs | |
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/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 5 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 8 |
3 files changed, 9 insertions, 8 deletions
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 |