diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-06 20:23:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-06 20:23:17 +0000 |
commit | 85674180ac0b414993bec634994ea51b28390306 (patch) | |
tree | 5ce384dfed739e368b8605fc6db4ed1f26a43609 /sys/kern/vfs_cluster.c | |
parent | 44f83f3e77b70fbce9f014e39cf5c97bae700213 (diff) |
back out vfs lite2 till after 2.2
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r-- | sys/kern/vfs_cluster.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 87b024600bc..b1017f6f21c 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cluster.c,v 1.9 1997/10/06 15:12:36 csapuntz Exp $ */ +/* $OpenBSD: vfs_cluster.c,v 1.10 1997/10/06 20:20:08 deraadt Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */ /*- @@ -48,6 +48,15 @@ #include <vm/vm.h> +#ifdef DEBUG +#include <sys/sysctl.h> +int doreallocblks = 0; +struct ctldebug debug13 = { "doreallocblks", &doreallocblks }; +#else +/* XXX for cluster_write */ +#define doreallocblks 0 +#endif + /* * Local declarations */ @@ -509,7 +518,8 @@ cluster_write(bp, filesize) * Otherwise try reallocating to make it sequential. */ cursize = vp->v_lastw - vp->v_cstart + 1; - if ((lbn + 1) * bp->b_bcount != filesize || + if (!doreallocblks || + (lbn + 1) * bp->b_bcount != filesize || lbn != vp->v_lastw + 1 || vp->v_clen <= cursize) { cluster_wbuild(vp, NULL, bp->b_bcount, vp->v_cstart, cursize, lbn); @@ -698,14 +708,13 @@ redo: panic("Clustered write to wrong blocks"); } - if (LIST_FIRST(&tbp->b_dep) != NULL && bioops.io_start) - (*bioops.io_start)(tbp); - pagemove(tbp->b_data, cp, size); bp->b_bcount += size; bp->b_bufsize += size; tbp->b_bufsize -= size; + if (tbp->b_flags & B_DELWRI) + TAILQ_REMOVE(&bdirties, tbp, b_synclist); tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); /* * We might as well AGE the buffer here; it's either empty, or |