Since the last parameter to vm_object_shadow() is a vm_size_t and not a

vm_pindex_t, it makes no sense for its callers to perform atop().  Let
vm_object_shadow() do that instead.
This commit is contained in:
Alan Cox 2011-02-04 21:49:24 +00:00
parent adc6846785
commit 0cc74f144e
2 changed files with 6 additions and 8 deletions

View File

@ -3077,8 +3077,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_charge)
vm_object_reference(object);
if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) {
vm_object_shadow(&old_entry->object.vm_object,
&old_entry->offset,
atop(old_entry->end - old_entry->start));
&old_entry->offset,
old_entry->end - old_entry->start);
old_entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
/* Transfer the second reference too. */
vm_object_reference(
@ -3589,8 +3589,8 @@ vm_map_lookup(vm_map_t *var_map, /* IN/OUT */
vm_prot_t prot;
vm_prot_t fault_type = fault_typea;
vm_object_t eobject;
vm_size_t size;
struct ucred *cred;
vm_ooffset_t size;
RetryLookup:;
@ -3677,10 +3677,8 @@ RetryLookup:;
}
entry->cred = cred;
}
vm_object_shadow(
&entry->object.vm_object,
&entry->offset,
atop(size));
vm_object_shadow(&entry->object.vm_object,
&entry->offset, size);
entry->eflags &= ~MAP_ENTRY_NEEDS_COPY;
eobject = entry->object.vm_object;
if (eobject->cred != NULL) {

View File

@ -1147,7 +1147,7 @@ vm_object_shadow(
/*
* Allocate a new object with the given length.
*/
result = vm_object_allocate(OBJT_DEFAULT, length);
result = vm_object_allocate(OBJT_DEFAULT, atop(length));
/*
* The new object shadows the source object, adding a reference to it.