* Complete a call to either prison_free or prison_proc_free. */
| 2765 | * Complete a call to either prison_free or prison_proc_free. |
| 2766 | */ |
| 2767 | static void |
| 2768 | prison_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). |
nothing calls this directly
no test coverage detected