summaryrefslogtreecommitdiff
path: root/libpager
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-18 19:40:28 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-18 19:40:28 +0000
commit84c1f72beb63c4a5c96d7cad35d67bb4ed3246c3 (patch)
tree237a0dc9982cd3f17e9747f5e6f550ec06328418 /libpager
parent74ecf5c22ed2011c7d1428c3eb22e381e6b49755 (diff)
(pager_offer_page): Flush page first if it's precious.
Diffstat (limited to 'libpager')
-rw-r--r--libpager/offer-page.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpager/offer-page.c b/libpager/offer-page.c
index 6140966e..42706929 100644
--- a/libpager/offer-page.c
+++ b/libpager/offer-page.c
@@ -28,6 +28,12 @@ pager_offer_page (struct pager *p,
vm_offset_t offset,
vm_address_t buf)
{
+ /* The caller expects this to get written back, but if the page is
+ currently resident then our request will get ignored, so flush it
+ first */
+ if (precious)
+ pager_flush_some (p, offset, vm_page_size, 1);
+
memory_object_data_supply (p->memobjcntl, offset, buf, vm_page_size, 0,
writelock ? VM_PROT_WRITE : VM_PROT_NONE,
precious, MACH_PORT_NULL);