summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-02 20:56:23 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-07-02 20:56:23 +0000
commit04c6a5055b8bebff2780514c2c67c17af2dd1e37 (patch)
tree20a8d17f36be6572cd7e90284de9c3f8791710bd /sys/ufs
parentd42a44fc6d8e96e5a28407cebe0eba9f3060d805 (diff)
Use more list macros for v_dirtyblkhd.
OK mpi@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c7
-rw-r--r--sys/ufs/ffs/ffs_vnops.c9
2 files changed, 7 insertions, 9 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 23a54fa94b3..c8ee770d2b6 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.142 2018/05/02 02:24:56 visa Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.143 2018/07/02 20:56:22 bluhm Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -4640,8 +4640,7 @@ softdep_fsync_mountdev(struct vnode *vp, int waitfor)
if (!vn_isdisk(vp, NULL))
panic("softdep_fsync_mountdev: vnode not a disk");
ACQUIRE_LOCK(&lk);
- for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = LIST_NEXT(bp, b_vnbufs);
+ LIST_FOREACH_SAFE(bp, &vp->v_dirtyblkhd, b_vnbufs, nbp) {
/*
* If it is already scheduled, skip to the next buffer.
*/
@@ -4932,7 +4931,7 @@ loop:
* all potential buffers on the dirty list will be visible.
*/
drain_output(vp, 1);
- if (LIST_FIRST(&vp->v_dirtyblkhd) == NULL) {
+ if (LIST_EMPTY(&vp->v_dirtyblkhd)) {
FREE_LOCK(&lk);
return (0);
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 0d14649adf0..99aeed83fd4 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vnops.c,v 1.90 2018/01/13 15:56:02 millert Exp $ */
+/* $OpenBSD: ffs_vnops.c,v 1.91 2018/07/02 20:56:22 bluhm Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */
/*
@@ -435,11 +435,10 @@ ffs_fsync(void *v)
skipmeta = 1;
s = splbio();
loop:
- for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp;
- bp = LIST_NEXT(bp, b_vnbufs))
+ LIST_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) {
bp->b_flags &= ~B_SCANNED;
- for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
- nbp = LIST_NEXT(bp, b_vnbufs);
+ }
+ LIST_FOREACH_SAFE(bp, &vp->v_dirtyblkhd, b_vnbufs, nbp) {
/*
* Reasons to skip this buffer: it has already been considered
* on this pass, this pass is the first time through on a