* Remove a reference from the g_consumer. Post a close event if all * references go away, since the function might be called from the * biodone context. */
| 2773 | * biodone context. |
| 2774 | */ |
| 2775 | static void |
| 2776 | swapgeom_release(struct g_consumer *cp, struct swdevt *sp) |
| 2777 | { |
| 2778 | |
| 2779 | mtx_assert(&sw_dev_mtx, MA_OWNED); |
| 2780 | cp->index--; |
| 2781 | if (cp->index == 0) { |
| 2782 | if (g_post_event(swapgeom_close_ev, cp, M_NOWAIT, NULL) == 0) |
| 2783 | sp->sw_id = NULL; |
| 2784 | } |
| 2785 | } |
| 2786 | |
| 2787 | static void |
| 2788 | swapgeom_done(struct bio *bp2) |
no test coverage detected