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

Function prison_complete

freebsd/kern/kern_jail.c:2767–2783  ·  view source on GitHub ↗

* Complete a call to either prison_free or prison_proc_free. */

Source from the content-addressed store, hash-verified

2765 * Complete a call to either prison_free or prison_proc_free.
2766 */
2767static void
2768prison_complete(void *context, int pending)
2769{
2770 struct prison *pr = context;
2771
2772 sx_xlock(&allprison_lock);
2773 mtx_lock(&pr->pr_mtx);
2774 /*
2775 * If this is completing a call to prison_proc_free, there will still
2776 * be a user reference held; clear that as well as the reference that
2777 * was added. No references are expected if this is completing a call
2778 * to prison_free, but prison_deref is still called for the cleanup.
2779 */
2780 prison_deref(pr, refcount_load(&pr->pr_uref) > 0
2781 ? PD_DEREF | PD_DEUREF | PD_LOCKED | PD_LIST_XLOCKED
2782 : PD_LOCKED | PD_LIST_XLOCKED);
2783}
2784
2785/*
2786 * Remove a prison reference and/or user reference (usually).

Callers

nothing calls this directly

Calls 3

prison_derefFunction · 0.85
refcount_loadFunction · 0.85
mtx_lockFunction · 0.70

Tested by

no test coverage detected