]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Move final zvol_remove_minors to common code
authorMatthew Macy <mmacy@freebsd.org>
Fri, 25 Oct 2019 20:42:54 +0000 (13:42 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 25 Oct 2019 20:42:54 +0000 (13:42 -0700)
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

module/os/linux/zfs/zvol_os.c
module/zfs/zvol.c

index 52725499a8701a3a9b8778450fe332fa4e0c27b4..f234b854454ddeecfa263ead3fe15586d5b95b62 100644 (file)
@@ -1092,16 +1092,6 @@ zvol_init(void)
 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();
        blk_unregister_region(MKDEV(zvol_major, 0), 1UL << MINORBITS);
        unregister_blkdev(zvol_major, ZVOL_DRIVER);
index 19c20afe7bc59188e5bf67b698e46be96a2a97b4..5006b6af8277b59dbd7260c847aecb12ac98c920 100644 (file)
@@ -1713,6 +1713,16 @@ zvol_init_impl(void)
 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));
        list_destroy(&zvol_state_list);
        rw_destroy(&zvol_state_lock);