diff options
author | alc <alc@FreeBSD.org> | 2009-11-02 17:45:39 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2009-11-02 17:45:39 +0000 |
commit | 9c1e3b8d87d3e25aeb840281c57f671a94b42366 (patch) | |
tree | ed114e94cf15f319f56e58b02a3f43069ecf8c25 | |
parent | 346b77e39e6735c4e9d426537e41a0098190a8e3 (diff) | |
download | FreeBSD-src-9c1e3b8d87d3e25aeb840281c57f671a94b42366.zip FreeBSD-src-9c1e3b8d87d3e25aeb840281c57f671a94b42366.tar.gz |
Avoid pointless calls to pmap_protect().
Reviewed by: kib
-rw-r--r-- | sys/vm/vm_map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 06ae63e..414d4e6 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1914,10 +1914,10 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, } /* - * Update physical map if necessary. Worry about copy-on-write - * here. + * When restricting access, update the physical map. Worry + * about copy-on-write here. */ - if (current->protection != old_prot) { + if ((old_prot & ~current->protection) != 0) { #define MASK(entry) (((entry)->eflags & MAP_ENTRY_COW) ? ~VM_PROT_WRITE : \ VM_PROT_ALL) pmap_protect(map->pmap, current->start, |