MCPcopy Create free account
hub / github.com/F-Stack/f-stack / default_pager_alloc

Function default_pager_alloc

freebsd/vm/default_pager.c:84–104  ·  view source on GitHub ↗

* Return an initialized object. */

Source from the content-addressed store, hash-verified

82 * Return an initialized object.
83 */
84static vm_object_t
85default_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
86 vm_ooffset_t offset, struct ucred *cred)
87{
88 vm_object_t object;
89
90 if (handle != NULL)
91 panic("default_pager_alloc: handle specified");
92 if (cred != NULL) {
93 if (!swap_reserve_by_cred(size, cred))
94 return (NULL);
95 crhold(cred);
96 }
97 object = vm_object_allocate(OBJT_DEFAULT,
98 OFF_TO_IDX(round_page(offset + size)));
99 if (cred != NULL) {
100 object->cred = cred;
101 object->charge = size;
102 }
103 return (object);
104}
105
106/*
107 * Deallocate resources associated with the object.

Callers

nothing calls this directly

Calls 4

swap_reserve_by_credFunction · 0.85
vm_object_allocateFunction · 0.85
panicFunction · 0.50
crholdFunction · 0.50

Tested by

no test coverage detected