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

Function vmspace_acquire_ref

freebsd/vm/vm_map.c:466–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464/* Acquire reference to vmspace owned by another process. */
465
466struct vmspace *
467vmspace_acquire_ref(struct proc *p)
468{
469 struct vmspace *vm;
470
471 PROC_VMSPACE_LOCK(p);
472 vm = p->p_vmspace;
473 if (vm == NULL || !refcount_acquire_if_not_zero(&vm->vm_refcnt)) {
474 PROC_VMSPACE_UNLOCK(p);
475 return (NULL);
476 }
477 if (vm != p->p_vmspace) {
478 PROC_VMSPACE_UNLOCK(p);
479 vmspace_free(vm);
480 return (NULL);
481 }
482 PROC_VMSPACE_UNLOCK(p);
483 return (vm);
484}
485
486/*
487 * Switch between vmspaces in an AIO kernel process.

Callers 8

sysctl_kern_proc_ovmmapFunction · 0.85
kern_proc_vmmap_outFunction · 0.85
aslr_statusFunction · 0.85
ptrace_vm_entryFunction · 0.85
soaio_kproc_loopFunction · 0.85
aio_daemonFunction · 0.85
vm_daemonFunction · 0.85
vm_pageout_oomFunction · 0.85

Calls 2

vmspace_freeFunction · 0.85

Tested by

no test coverage detected