From 84c1f72beb63c4a5c96d7cad35d67bb4ed3246c3 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 18 Apr 1996 19:40:28 +0000 Subject: (pager_offer_page): Flush page first if it's precious. --- libpager/offer-page.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.3