summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-05-31 16:42:45 +0000
committerphk <phk@FreeBSD.org>2003-05-31 16:42:45 +0000
commit0129a20107a4d816f5acb9c683952803b97583be (patch)
tree5bac77896fbd3b5412e6f42140c8335ad91f96d2 /sys
parent8c39502975cf4f5d36d87e3991fb70ba5ce2f8ac (diff)
downloadFreeBSD-src-0129a20107a4d816f5acb9c683952803b97583be.zip
FreeBSD-src-0129a20107a4d816f5acb9c683952803b97583be.tar.gz
The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to prevent
deadlocks with vnode backed md(4) devices because md now uses a kthread to run the bio requests instead of doing it directly from the bio down path.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/md/md.c5
-rw-r--r--sys/kern/vfs_bio.c10
-rw-r--r--sys/kern/vfs_cluster.c2
-rw-r--r--sys/nfsclient/nfs_bio.c6
-rw-r--r--sys/sys/buf.h6
-rw-r--r--sys/sys/vnode.h1
-rw-r--r--sys/ufs/ffs/ffs_vnops.c4
7 files changed, 7 insertions, 27 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 7071a3e..1577f02 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -497,8 +497,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
auio.uio_td = curthread;
/*
* When reading set IO_DIRECT to try to avoid double-caching
- * the data. When writing IO_DIRECT is not optimal, but we
- * must set IO_NOWDRAIN to avoid a wdrain deadlock.
+ * the data. When writing IO_DIRECT is not optimal.
*/
if (bp->bio_cmd == BIO_READ) {
vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY, curthread);
@@ -506,7 +505,7 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
} else {
(void) vn_start_write(sc->vnode, &mp, V_WAIT);
vn_lock(sc->vnode, LK_EXCLUSIVE | LK_RETRY, curthread);
- error = VOP_WRITE(sc->vnode, &auio, IO_NOWDRAIN, sc->cred);
+ error = VOP_WRITE(sc->vnode, &auio, 0, sc->cred);
vn_finished_write(mp);
}
VOP_UNLOCK(sc->vnode, 0, curthread);
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 0b4a643..e1c0f9e 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -882,13 +882,10 @@ bwrite(struct buf * bp)
int rtval = bufwait(bp);
brelse(bp);
return (rtval);
- } else if ((oldflags & B_NOWDRAIN) == 0) {
+ } else {
/*
* don't allow the async write to saturate the I/O
- * system. Deadlocks can occur only if a device strategy
- * routine (like in MD) turns around and issues another
- * high-level write, in which case B_NOWDRAIN is expected
- * to be set. Otherwise we will not deadlock here because
+ * system. We will not deadlock here because
* we are blocking waiting for I/O that is already in-progress
* to complete.
*/
@@ -1461,8 +1458,7 @@ brelse(struct buf * bp)
if (bp->b_bufsize || bp->b_kvasize)
bufspacewakeup();
- bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF |
- B_DIRECT | B_NOWDRAIN);
+ bp->b_flags &= ~(B_ASYNC | B_NOCACHE | B_AGE | B_RELBUF | B_DIRECT);
if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY))
panic("brelse: not dirty");
/* unlock */
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 85fb8b3..72e80d6 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -839,7 +839,7 @@ cluster_wbuild(vp, size, start_lbn, len)
bp->b_data = (char *)((vm_offset_t)bp->b_data |
((vm_offset_t)tbp->b_data & PAGE_MASK));
bp->b_flags |= B_CLUSTER |
- (tbp->b_flags & (B_VMIO | B_NEEDCOMMIT | B_NOWDRAIN));
+ (tbp->b_flags & (B_VMIO | B_NEEDCOMMIT));
bp->b_iodone = cluster_callback;
pbgetvp(vp, bp);
/*
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 088be65..f36cbcb 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -973,12 +973,6 @@ again:
}
vfs_bio_set_validclean(bp, on, n);
}
- /*
- * If IO_NOWDRAIN then set B_NOWDRAIN (nfs-backed MD
- * filesystem)
- */
- if (ioflag & IO_NOWDRAIN)
- bp->b_flags |= B_NOWDRAIN;
/*
* If IO_SYNC do bwrite().
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 60d0d42..e41110f 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -206,10 +206,6 @@ struct buf {
* sticky until the buffer is released and typically
* only has an effect when B_RELBUF is also set.
*
- * B_NOWDRAIN This flag should be set when a device (like MD)
- * does a turn-around VOP_WRITE from its strategy
- * routine. This flag prevents bwrite() from blocking
- * in wdrain, avoiding a deadlock situation.
*/
#define B_AGE 0x00000001 /* Move to age queue when I/O done. */
@@ -223,7 +219,7 @@ struct buf {
#define B_00000100 0x00000100 /* Available flag. */
#define B_DONE 0x00000200 /* I/O completed. */
#define B_EINTR 0x00000400 /* I/O was interrupted */
-#define B_NOWDRAIN 0x00000800 /* Avoid wdrain deadlock */
+#define B_00000800 0x00000800 /* Availabel flag. */
#define B_00001000 0x00001000 /* Available flag. */
#define B_INVAL 0x00002000 /* Does not contain valid info. */
#define B_LOCKED 0x00004000 /* Locked in core (not reusable). */
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index e48d392..230d4d3 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -279,7 +279,6 @@ struct vattr {
#define IO_INVAL 0x0040 /* invalidate after I/O */
#define IO_ASYNC 0x0080 /* bawrite rather then bdwrite */
#define IO_DIRECT 0x0100 /* attempt to bypass buffer cache */
-#define IO_NOWDRAIN 0x0200 /* do not block on wdrain */
#define IO_EXT 0x0400 /* operate on external attributes */
#define IO_NORMAL 0x0800 /* operate on regular data */
#define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 9bcd7ff..910c0e4 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -702,8 +702,6 @@ ffs_write(ap)
vfs_bio_clrbuf(bp);
if (ioflag & IO_DIRECT)
bp->b_flags |= B_DIRECT;
- if (ioflag & IO_NOWDRAIN)
- bp->b_flags |= B_NOWDRAIN;
if (uio->uio_offset + xfersize > ip->i_size) {
ip->i_size = uio->uio_offset + xfersize;
@@ -1163,8 +1161,6 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *ucred)
vfs_bio_clrbuf(bp);
if (ioflag & IO_DIRECT)
bp->b_flags |= B_DIRECT;
- if (ioflag & IO_NOWDRAIN)
- bp->b_flags |= B_NOWDRAIN;
if (uio->uio_offset + xfersize > dp->di_extsize)
dp->di_extsize = uio->uio_offset + xfersize;
OpenPOWER on IntegriCloud