Remove locking around accounting initialization of the default object.

The object is not yet fully constructed and must not be available to
other threads.  This makes default_pager_alloc() almost identical to
swap_pager_alloc_init().

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2016-12-14 23:34:25 +00:00
parent ea79716e67
commit 3bda92f604

View File

@ -85,10 +85,8 @@ default_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
object = vm_object_allocate(OBJT_DEFAULT,
OFF_TO_IDX(round_page(offset + size)));
if (cred != NULL) {
VM_OBJECT_WLOCK(object);
object->cred = cred;
object->charge = size;
VM_OBJECT_WUNLOCK(object);
}
return (object);
}