Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_fault.c
Show First 20 Lines • Show All 1,257 Lines • ▼ Show 20 Lines | if ((fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { | ||||
(fs.object->ref_count == 1) && | (fs.object->ref_count == 1) && | ||||
/* | /* | ||||
* No one else can look this object up | * No one else can look this object up | ||||
*/ | */ | ||||
(fs.object->handle == NULL) && | (fs.object->handle == NULL) && | ||||
/* | /* | ||||
* No other ways to look the object up | * No other ways to look the object up | ||||
*/ | */ | ||||
((fs.object->type == OBJT_DEFAULT) || | ((fs.object->flags & OBJ_ANON) != 0) && | ||||
(fs.object->type == OBJT_SWAP)) && | |||||
(is_first_object_locked = VM_OBJECT_TRYWLOCK(fs.first_object)) && | (is_first_object_locked = VM_OBJECT_TRYWLOCK(fs.first_object)) && | ||||
/* | /* | ||||
* We don't chase down the shadow chain | * We don't chase down the shadow chain | ||||
*/ | */ | ||||
fs.object == fs.first_object->backing_object && | fs.object == fs.first_object->backing_object && | ||||
(VM_OBJECT_WOWNED(fs.object) || | (VM_OBJECT_WOWNED(fs.object) || | ||||
VM_OBJECT_TRYUPGRADE(fs.object) != 0)) { | VM_OBJECT_TRYUPGRADE(fs.object) != 0)) { | ||||
▲ Show 20 Lines • Show All 484 Lines • ▼ Show 20 Lines | #endif /* lint */ | ||||
if (upgrade && (dst_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { | if (upgrade && (dst_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { | ||||
dst_object = src_object; | dst_object = src_object; | ||||
vm_object_reference(dst_object); | vm_object_reference(dst_object); | ||||
} else { | } else { | ||||
/* | /* | ||||
* Create the top-level object for the destination entry. (Doesn't | * Create the top-level object for the destination entry. (Doesn't | ||||
* actually shadow anything - we copy the pages directly.) | * actually shadow anything - we copy the pages directly.) | ||||
*/ | */ | ||||
dst_object = vm_object_allocate(OBJT_DEFAULT, | dst_object = vm_object_allocate_anon( | ||||
atop(dst_entry->end - dst_entry->start)); | atop(dst_entry->end - dst_entry->start)); | ||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
dst_object->flags |= OBJ_COLORED; | dst_object->flags |= OBJ_COLORED; | ||||
dst_object->pg_color = atop(dst_entry->start); | dst_object->pg_color = atop(dst_entry->start); | ||||
#endif | #endif | ||||
dst_object->domain = src_object->domain; | dst_object->domain = src_object->domain; | ||||
dst_object->charge = dst_entry->end - dst_entry->start; | dst_object->charge = dst_entry->end - dst_entry->start; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 178 Lines • Show Last 20 Lines |