* Applied fixes from Bruce Evans to fix COW bugs, >1MB kernel loading,
[unix-history] / sys / vm / vm_map.c
index 9905b25..4d9e5ef 100644 (file)
@@ -74,6 +74,7 @@
  */
 
 #include "param.h"
  */
 
 #include "param.h"
+#include "systm.h"
 #include "malloc.h"
 #include "vm.h"
 #include "vm_page.h"
 #include "malloc.h"
 #include "vm.h"
 #include "vm_page.h"
@@ -1130,8 +1131,6 @@ vm_map_pageable(map, start, end, new_pageable)
 {
        register vm_map_entry_t entry;
        vm_map_entry_t          temp_entry;
 {
        register vm_map_entry_t entry;
        vm_map_entry_t          temp_entry;
-       register vm_offset_t    failed;
-       int                     rv;
 
        vm_map_lock(map);
 
 
        vm_map_lock(map);
 
@@ -1284,26 +1283,10 @@ vm_map_pageable(map, start, end, new_pageable)
                    lock_write_to_read(&map->lock);
                }
 
                    lock_write_to_read(&map->lock);
                }
 
-               rv = 0;
                entry = temp_entry;
                while (entry != &map->header && entry->start < end) {
                entry = temp_entry;
                while (entry != &map->header && entry->start < end) {
-                   /*
-                    * If vm_fault_wire fails for any page we need to
-                    * undo what has been done.  We decrement the wiring
-                    * count for those pages which have not yet been
-                    * wired (now) and unwire those that have (later).
-                    *
-                    * XXX this violates the locking protocol on the map,
-                    * needs to be fixed.
-                    */
-                   if (rv)
-                       entry->wired_count--;
-                   else if (entry->wired_count == 1) {
-                       rv = vm_fault_wire(map, entry->start, entry->end);
-                       if (rv) {
-                           failed = entry->start;
-                           entry->wired_count--;
-                   }
+                   if (entry->wired_count == 1) {
+                       vm_fault_wire(map, entry->start, entry->end);
                    }
                    entry = entry->next;
                }
                    }
                    entry = entry->next;
                }
@@ -1314,11 +1297,6 @@ vm_map_pageable(map, start, end, new_pageable)
                else {
                    lock_clear_recursive(&map->lock);
                }
                else {
                    lock_clear_recursive(&map->lock);
                }
-               if (rv) {
-                   vm_map_unlock(map);
-                   (void) vm_map_pageable(map, start, failed, TRUE);
-                   return(rv);
-               }
        }
 
        vm_map_unlock(map);
        }
 
        vm_map_unlock(map);