]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Remove locking around accounting initialization of the default object.
authorkib <kib@FreeBSD.org>
Wed, 14 Dec 2016 23:34:25 +0000 (23:34 +0000)
committerkib <kib@FreeBSD.org>
Wed, 14 Dec 2016 23:34:25 +0000 (23:34 +0000)
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

sys/vm/default_pager.c

index 7fc4f6c49e00d5f7f1146444c905602b3fd864dd..d08e5f54a318819f44e995cd6c90c4413947dc2e 100644 (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);
 }