]> granicus.if.org Git - zfs/commitdiff
Use taskq_wait_outstanding() function
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Jun 2015 18:26:35 +0000 (11:26 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 11 Jun 2015 17:27:25 +0000 (10:27 -0700)
Replace taskq_wait() with taskq_wait_oustanding().  This way callers
will only block until previously submitted tasks have been completed.
This was the previous behavior of task_wait() prior to the introduction
of taskq_wait_outstanding() so this isn't really a functionalty change
for these callers.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/zfs/metaslab.c
module/zfs/txg.c
module/zfs/zfs_vfsops.c

index 164b6b87edd40b43639817c5c6299cfc077bbcce..7ff1a4f5af7ee2da9229498ce25b97dce196036c 100644 (file)
@@ -556,7 +556,7 @@ metaslab_group_passivate(metaslab_group_t *mg)
                return;
        }
 
-       taskq_wait(mg->mg_taskq);
+       taskq_wait_outstanding(mg->mg_taskq, 0);
        metaslab_group_alloc_update(mg);
 
        mgprev = mg->mg_prev;
@@ -1596,7 +1596,7 @@ metaslab_group_preload(metaslab_group_t *mg)
        int m = 0;
 
        if (spa_shutting_down(spa) || !metaslab_preload_enabled) {
-               taskq_wait(mg->mg_taskq);
+               taskq_wait_outstanding(mg->mg_taskq, 0);
                return;
        }
 
index 2977bf9f34045f989f13f8952afda3f3fd8eaacb..c542b0a75248aa0beae6366b289696abdc01443e 100644 (file)
@@ -471,7 +471,7 @@ txg_wait_callbacks(dsl_pool_t *dp)
        tx_state_t *tx = &dp->dp_tx;
 
        if (tx->tx_commit_cb_taskq != NULL)
-               taskq_wait(tx->tx_commit_cb_taskq);
+               taskq_wait_outstanding(tx->tx_commit_cb_taskq, 0);
 }
 
 static void
index e86b21aeed61a1b3b8d3bcc1758ea6233f6ae9c9..2b532a33359a41645b315c8c9f610867ffaa5ec1 100644 (file)
@@ -1152,8 +1152,8 @@ zfs_sb_teardown(zfs_sb_t *zsb, boolean_t unmounting)
                 */
                int round = 0;
                while (zsb->z_nr_znodes > 0) {
-                       taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(
-                           zsb->z_os)));
+                       taskq_wait_outstanding(dsl_pool_iput_taskq(
+                           dmu_objset_pool(zsb->z_os)), 0);
                        if (++round > 1 && !unmounting)
                                break;
                }
@@ -1740,7 +1740,7 @@ zfs_init(void)
 void
 zfs_fini(void)
 {
-       taskq_wait(system_taskq);
+       taskq_wait_outstanding(system_taskq, 0);
        unregister_filesystem(&zpl_fs_type);
        zfs_znode_fini();
        zfsctl_fini();