Move final zvol_remove_minors to common code

This logic is not platform dependent and should reside in the
common code.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9505
This commit is contained in:
Matthew Macy 2019-10-25 13:42:54 -07:00 committed by Brian Behlendorf
parent 1952fe0e25
commit c392c5aec0
2 changed files with 10 additions and 10 deletions

View File

@ -1092,16 +1092,6 @@ zvol_init(void)
void void
zvol_fini(void) zvol_fini(void)
{ {
zvol_remove_minors_impl(NULL);
/*
* The call to "zvol_remove_minors_impl" may dispatch entries to
* the system_taskq, but it doesn't wait for those entires to
* complete before it returns. Thus, we must wait for all of the
* removals to finish, before we can continue.
*/
taskq_wait_outstanding(system_taskq, 0);
zvol_fini_impl(); zvol_fini_impl();
blk_unregister_region(MKDEV(zvol_major, 0), 1UL << MINORBITS); blk_unregister_region(MKDEV(zvol_major, 0), 1UL << MINORBITS);
unregister_blkdev(zvol_major, ZVOL_DRIVER); unregister_blkdev(zvol_major, ZVOL_DRIVER);

View File

@ -1713,6 +1713,16 @@ zvol_init_impl(void)
void void
zvol_fini_impl(void) zvol_fini_impl(void)
{ {
zvol_remove_minors_impl(NULL);
/*
* The call to "zvol_remove_minors_impl" may dispatch entries to
* the system_taskq, but it doesn't wait for those entires to
* complete before it returns. Thus, we must wait for all of the
* removals to finish, before we can continue.
*/
taskq_wait_outstanding(system_taskq, 0);
kmem_free(zvol_htable, ZVOL_HT_SIZE * sizeof (struct hlist_head)); kmem_free(zvol_htable, ZVOL_HT_SIZE * sizeof (struct hlist_head));
list_destroy(&zvol_state_list); list_destroy(&zvol_state_list);
rw_destroy(&zvol_state_lock); rw_destroy(&zvol_state_lock);