summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2011-01-01 17:39:38 +0000
committeralc <alc@FreeBSD.org>2011-01-01 17:39:38 +0000
commit7fb616e10a032735e108811a5ef8d9dac10dcb8b (patch)
tree7cb7188fe97076ed1db137971b7488bc78ce564f
parent688b83a0a69ecf424430666f5ad5834f0e012017 (diff)
downloadFreeBSD-src-7fb616e10a032735e108811a5ef8d9dac10dcb8b.zip
FreeBSD-src-7fb616e10a032735e108811a5ef8d9dac10dcb8b.tar.gz
Make a couple refinements to r216799 and r216810. In particular, revise
a comment and move it to its proper place. Reviewed by: kib
-rw-r--r--sys/vm/vm_object.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index e34c3e9..9e04da6 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -755,6 +755,12 @@ vm_object_terminate(vm_object_t object)
vm_object_destroy(object);
}
+/*
+ * Make the page read-only so that we can clear the object flags. However, if
+ * this is a nosync mmap then the object is likely to stay dirty so do not
+ * mess with the page and do not clear the object flags. Returns TRUE if the
+ * page should be flushed, and FALSE otherwise.
+ */
static boolean_t
vm_object_page_remove_write(vm_page_t p, int flags, int *clearobjflags)
{
@@ -808,15 +814,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end,
pagerflags |= (flags & OBJPC_INVAL) != 0 ? VM_PAGER_PUT_INVAL : 0;
tend = (end == 0) ? object->size : end;
-
- /*
- * Make the page read-only so we can then clear the object flags.
- *
- * However, if this is a nosync mmap then the object is likely to
- * stay dirty so do not mess with the page and do not clear the
- * object flags.
- */
- clearobjflags = 1;
+ clearobjflags = start == 0 && tend == object->size;
rescan:
curgeneration = object->generation;
@@ -847,7 +845,7 @@ rescan:
VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0);
#endif
- if (clearobjflags && start == 0 && tend == object->size)
+ if (clearobjflags)
vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY);
}
OpenPOWER on IntegriCloud