summaryrefslogtreecommitdiffstats
path: root/sys/ufs/lfs
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-09 06:03:56 +0000
committerdg <dg@FreeBSD.org>1995-04-09 06:03:56 +0000
commitb804a532828494b010ef0df5ed1bdef80932bc75 (patch)
treed7255955eb6b243461a28e283cd09739dbf8dbe7 /sys/ufs/lfs
parent78a655a0460b2e110a8aee7d5ee8ae5d27258f2f (diff)
downloadFreeBSD-src-b804a532828494b010ef0df5ed1bdef80932bc75.zip
FreeBSD-src-b804a532828494b010ef0df5ed1bdef80932bc75.tar.gz
Changes from John Dyson and myself:
Fixed remaining known bugs in the buffer IO and VM system. vfs_bio.c: Fixed some race conditions and locking bugs. Improved performance by removing some (now) unnecessary code and fixing some broken logic. Fixed process accounting of # of FS outputs. Properly handle NFS interrupts (B_EINTR). (various) Replaced calls to clrbuf() with calls to an optimized routine called vfs_bio_clrbuf(). (various FS sync) Sync out modified vnode_pager backed pages. ffs_vnops.c: Do two passes: Sync out file data first, then indirect blocks. vm_fault.c: Fixed deadly embrace caused by acquiring locks in the wrong order. vnode_pager.c: Changed to use buffer I/O system for writing out modified pages. This should fix the problem with the modification date previous not getting updated. Also dramatically simplifies the code. Note that this is going to change in the future and be implemented via VOP_PUTPAGES(). vm_object.c: Fixed a pile of bugs related to cleaning (vnode) objects. The performance of vm_object_page_clean() is terrible when dealing with huge objects, but this will change when we implement a binary tree to keep the object pages sorted. vm_pageout.c: Fixed broken clustering of pageouts. Fixed race conditions and other lockup style bugs in the scanning of pages. Improved performance.
Diffstat (limited to 'sys/ufs/lfs')
-rw-r--r--sys/ufs/lfs/lfs_balloc.c6
-rw-r--r--sys/ufs/lfs/lfs_vnops.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/sys/ufs/lfs/lfs_balloc.c b/sys/ufs/lfs/lfs_balloc.c
index e51d830..8491494 100644
--- a/sys/ufs/lfs/lfs_balloc.c
+++ b/sys/ufs/lfs/lfs_balloc.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_balloc.c 8.1 (Berkeley) 6/11/93
- * $Id: lfs_balloc.c,v 1.4 1995/03/04 03:24:43 davidg Exp $
+ * $Id: lfs_balloc.c,v 1.5 1995/03/28 07:58:02 bde Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -99,7 +99,7 @@ lfs_balloc(vp, iosize, lbn, bpp)
} else {
ip->i_blocks += bb;
ip->i_lfs->lfs_bfree -= bb;
- clrbuf(ibp);
+ vfs_bio_clrbuf(ibp);
error = VOP_BWRITE(ibp);
}
} else
@@ -123,7 +123,7 @@ lfs_balloc(vp, iosize, lbn, bpp)
ip->i_blocks += bb;
ip->i_lfs->lfs_bfree -= bb;
if (iosize != fs->lfs_bsize)
- clrbuf(bp);
+ vfs_bio_clrbuf(bp);
}
else if (iosize == fs->lfs_bsize)
bp->b_blkno = daddr; /* Skip the I/O */
diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c
index 0a90fe7..eff079f 100644
--- a/sys/ufs/lfs/lfs_vnops.c
+++ b/sys/ufs/lfs/lfs_vnops.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93
- * $Id: lfs_vnops.c,v 1.6 1995/01/04 23:46:34 gibbs Exp $
+ * $Id: lfs_vnops.c,v 1.7 1995/03/28 07:58:06 bde Exp $
*/
#include <sys/param.h>
@@ -50,6 +50,8 @@
#include <sys/malloc.h>
#include <vm/vm.h>
+#include <vm/vm_page.h>
+#include <vm/vm_object.h>
#include <miscfs/specfs/specdev.h>
#include <miscfs/fifofs/fifo.h>
@@ -232,6 +234,13 @@ lfs_fsync(ap)
struct timeval tv;
int error;
tv = time;
+ /*
+ * If the vnode has an object, then flush all of the dirty pages
+ * into the buffer cache.
+ */
+ if (ap->a_vp->v_vmdata)
+ _vm_object_page_clean((vm_object_t)ap->a_vp->v_vmdata, 0, 0, 0);
+
error = (VOP_UPDATE(ap->a_vp, &tv, &tv,
ap->a_waitfor == MNT_WAIT ? LFS_SYNC : 0));
if(ap->a_waitfor == MNT_WAIT && ap->a_vp->v_dirtyblkhd.lh_first != NULL)
OpenPOWER on IntegriCloud