diff options
author | dyson <dyson@FreeBSD.org> | 1998-05-21 07:47:58 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-05-21 07:47:58 +0000 |
commit | d26bce6481da9a31a8c8f3681d9808a35e47dd6b (patch) | |
tree | 8ce6b62d0797844260c379f8cba69acc8dafd12a /sys/vm/vm_object.c | |
parent | d29d2f09f459c94a799d7c3c0ca293a03bcf6021 (diff) | |
download | FreeBSD-src-d26bce6481da9a31a8c8f3681d9808a35e47dd6b.zip FreeBSD-src-d26bce6481da9a31a8c8f3681d9808a35e47dd6b.tar.gz |
Make flushing dirty pages work correctly on filesystems that
unexpectedly do not complete writes even with sync I/O requests.
This should help the behavior of mmaped files when using
softupdates (and perhaps in other circumstances also.)
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index f1abad0..df91aa0 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.119 1998/03/16 01:55:52 dyson Exp $ + * $Id: vm_object.c,v 1.120 1998/04/29 04:28:09 dyson Exp $ */ /* @@ -74,6 +74,7 @@ #include <sys/vnode.h> #include <sys/vmmeter.h> #include <sys/mman.h> +#include <sys/mount.h> #include <vm/vm.h> #include <vm/vm_param.h> @@ -651,13 +652,20 @@ rescan: ma[index]->flags &= ~PG_CLEANCHK; } runlen = maxb + maxf + 1; + splx(s); vm_pageout_flush(ma, runlen, pagerflags); + for (i = 0; i<runlen; i++) { + if (ma[i]->valid & ma[i]->dirty) { + vm_page_protect(ma[i], VM_PROT_READ); + ma[i]->flags |= PG_CLEANCHK; + } + } if (object->generation != curgeneration) goto rescan; } - VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?1:0, curproc); + VOP_FSYNC(vp, NULL, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc); object->flags &= ~OBJ_CLEANING; return; |