summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrigoriy Orlov <gluk@cvs.openbsd.org>2001-09-20 08:22:27 +0000
committerGrigoriy Orlov <gluk@cvs.openbsd.org>2001-09-20 08:22:27 +0000
commit6404b4e0d313b4c9cadb0d718b9f53189200db76 (patch)
tree22926b20af0a827097d6f65091523cb1d7e50a54
parent6422bf2d43df9d1fe41ac503d25c76e29c55b63f (diff)
Get rid of B_VFLUSH. Tested by costa and me.
-rw-r--r--sys/kern/vfs_bio.c35
-rw-r--r--sys/sys/buf.h5
2 files changed, 10 insertions, 30 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index d97339469ec..efd38401530 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.42 2001/09/19 18:05:27 art Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.43 2001/09/20 08:22:26 gluk Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*-
@@ -544,20 +544,6 @@ brelse(bp)
if (ISSET(bp->b_flags, (B_NOCACHE|B_ERROR)))
SET(bp->b_flags, B_INVAL);
- if (ISSET(bp->b_flags, B_VFLUSH)) {
- /*
- * This is a delayed write buffer that was just flushed to
- * disk. It is still on the DIRTY queue. If it's become
- * invalid, then we need to move it to a different queue;
- * If buffer was redirtied (because it has dependencies),
- * leave it in its current position.
- */
- CLR(bp->b_flags, B_VFLUSH);
- if (!ISSET(bp->b_flags, B_ERROR|B_INVAL|B_LOCKED|B_AGE))
- goto already_queued;
- bremfree(bp);
- }
-
if ((bp->b_bufsize <= 0) || ISSET(bp->b_flags, B_INVAL)) {
/*
* If it's invalid or empty, dissociate it from its vnode
@@ -608,7 +594,6 @@ brelse(bp)
binstailfree(bp, bufq);
}
-already_queued:
/* Unlock the buffer. */
CLR(bp->b_flags, (B_AGE | B_ASYNC | B_BUSY | B_NOCACHE | B_DEFERRED));
@@ -948,7 +933,7 @@ void
buf_daemon(struct proc *p)
{
int s;
- struct buf *bp, *nbp;
+ struct buf *bp;
struct timeval starttime, timediff;
flusherproc = curproc;
@@ -960,23 +945,20 @@ buf_daemon(struct proc *p)
starttime = time;
s = splbio();
- for (bp = TAILQ_FIRST(&bufqueues[BQ_DIRTY]); bp; bp = nbp) {
- nbp = TAILQ_NEXT(bp, b_freelist);
- if (ISSET(bp->b_flags, B_VFLUSH))
- continue;
+ while ((bp = TAILQ_FIRST(&bufqueues[BQ_DIRTY]))) {
bremfree(bp);
SET(bp->b_flags, B_BUSY);
splx(s);
-#ifdef DIAGNOSTIC
- if (!ISSET(bp->b_flags, B_DELWRI))
- panic("Clean buffer on BQ_DIRTY");
-#endif
+
if (ISSET(bp->b_flags, B_INVAL)) {
brelse(bp);
s = splbio();
continue;
}
-
+#ifdef DIAGNOSTIC
+ if (!ISSET(bp->b_flags, B_DELWRI))
+ panic("Clean buffer on BQ_DIRTY");
+#endif
if (LIST_FIRST(&bp->b_dep) != NULL &&
!ISSET(bp->b_flags, B_DEFERRED) &&
buf_countdeps(bp, 0, 1)) {
@@ -998,7 +980,6 @@ buf_daemon(struct proc *p)
break;
s = splbio();
- nbp = TAILQ_FIRST(&bufqueues[BQ_DIRTY]);
}
}
}
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 687ed905741..f8f5cf70b0f 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.h,v 1.28 2001/09/17 19:17:30 gluk Exp $ */
+/* $OpenBSD: buf.h,v 1.29 2001/09/20 08:22:26 gluk Exp $ */
/* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */
/*
@@ -148,9 +148,8 @@ struct buf {
#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */
#define B_WRITEINPROG 0x01000000 /* Write in progress. */
#define B_XXX 0x02000000 /* Debugging flag. */
-#define B_VFLUSH 0x04000000 /* Buffer is being synced. */
+#define B_DEFERRED 0x04000000 /* Skipped over for cleaning */
#define B_SCANNED 0x08000000 /* Block already pushed during sync */
-#define B_DEFERRED 0x10000000 /* Skipped over for cleaning */
/*
* This structure describes a clustered I/O. It is stored in the b_saveaddr