From 80de1e9903d8e9fec77a1350f54dddaa9a5c7ac9 Mon Sep 17 00:00:00 2001 From: thorpej Date: Wed, 26 May 1999 23:53:48 +0000 Subject: [PATCH] Upon further investigation, in uvm_map_pageable(), entry->protection is the right access_type to pass to uvm_fault_wire(). This way, if the entry has VM_PROT_WRITE, and the entry is marked COW, the copy will happen immediately in uvm_fault(), as if the access were performed. --- sys/uvm/uvm_map.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 112957cf8703..3ab6c199307b 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.45 1999/05/26 19:16:36 thorpej Exp $ */ +/* $NetBSD: uvm_map.c,v 1.46 1999/05/26 23:53:48 thorpej Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -2169,14 +2169,8 @@ uvm_map_pageable(map, start, end, new_pageable) if (rv) { entry->wired_count--; } else if (entry->wired_count == 1) { - /* - * XXXTHORPEJ: VM_PROT_NONE. What about COW - * entries? Should we enter with max_protection - * so that we're guaranteed not even mod/ref - * emulation faults will occur? - */ rv = uvm_fault_wire(map, entry->start, entry->end, - VM_PROT_NONE); + entry->protection); if (rv) { failed = entry->start; entry->wired_count--;