diff options
author | kib <kib@FreeBSD.org> | 2012-10-22 17:50:54 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-10-22 17:50:54 +0000 |
commit | 560aa751e0f5cfef868bdf3fab01cdbc5169ef82 (patch) | |
tree | 6e9ef0a47c5e91d26227820c50c9767e84550821 /sys/kern/vfs_bio.c | |
parent | ca71b68ea40c83f641d6485e027368568f244197 (diff) | |
download | FreeBSD-src-560aa751e0f5cfef868bdf3fab01cdbc5169ef82.zip FreeBSD-src-560aa751e0f5cfef868bdf3fab01cdbc5169ef82.tar.gz |
Remove the support for using non-mpsafe filesystem modules.
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.
The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.
Conducted and reviewed by: attilio
Tested by: pho
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r-- | sys/kern/vfs_bio.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 626847c..0480bd4 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -266,14 +266,13 @@ static struct mtx nblock; /* * Definitions for the buffer free lists. */ -#define BUFFER_QUEUES 6 /* number of free buffer queues */ +#define BUFFER_QUEUES 5 /* number of free buffer queues */ #define QUEUE_NONE 0 /* on no queue */ #define QUEUE_CLEAN 1 /* non-B_DELWRI buffers */ #define QUEUE_DIRTY 2 /* B_DELWRI buffers */ -#define QUEUE_DIRTY_GIANT 3 /* B_DELWRI buffers that need giant */ -#define QUEUE_EMPTYKVA 4 /* empty buffer headers w/KVA assignment */ -#define QUEUE_EMPTY 5 /* empty buffer headers */ +#define QUEUE_EMPTYKVA 3 /* empty buffer headers w/KVA assignment */ +#define QUEUE_EMPTY 4 /* empty buffer headers */ #define QUEUE_SENTINEL 1024 /* not an queue index, but mark for sentinel */ /* Queues for free buffers with various properties */ @@ -1461,10 +1460,7 @@ brelse(struct buf *bp) TAILQ_INSERT_HEAD(&bufqueues[QUEUE_CLEAN], bp, b_freelist); /* remaining buffers */ } else { - if ((bp->b_flags & (B_DELWRI|B_NEEDSGIANT)) == - (B_DELWRI|B_NEEDSGIANT)) - bp->b_qindex = QUEUE_DIRTY_GIANT; - else if (bp->b_flags & B_DELWRI) + if (bp->b_flags & B_DELWRI) bp->b_qindex = QUEUE_DIRTY; else bp->b_qindex = QUEUE_CLEAN; @@ -1561,10 +1557,7 @@ bqrelse(struct buf *bp) panic("bqrelse: free buffer onto another queue???"); /* buffers with stale but valid contents */ if (bp->b_flags & B_DELWRI) { - if (bp->b_flags & B_NEEDSGIANT) - bp->b_qindex = QUEUE_DIRTY_GIANT; - else - bp->b_qindex = QUEUE_DIRTY; + bp->b_qindex = QUEUE_DIRTY; TAILQ_INSERT_TAIL(&bufqueues[bp->b_qindex], bp, b_freelist); } else { /* @@ -2170,12 +2163,6 @@ buf_do_flush(struct vnode *vp) int flushed; flushed = flushbufqueues(vp, QUEUE_DIRTY, 0); - /* The list empty check here is slightly racy */ - if (!TAILQ_EMPTY(&bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushed += flushbufqueues(vp, QUEUE_DIRTY_GIANT, 0); - mtx_unlock(&Giant); - } if (flushed == 0) { /* * Could not find any buffers without rollback @@ -2183,12 +2170,6 @@ buf_do_flush(struct vnode *vp) * in the hopes of eventually making progress. */ flushbufqueues(vp, QUEUE_DIRTY, 1); - if (!TAILQ_EMPTY( - &bufqueues[QUEUE_DIRTY_GIANT])) { - mtx_lock(&Giant); - flushbufqueues(vp, QUEUE_DIRTY_GIANT, 1); - mtx_unlock(&Giant); - } } return (flushed); } |