diff options
Diffstat (limited to 'module/zfs/txg.c')
-rw-r--r-- | module/zfs/txg.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/module/zfs/txg.c b/module/zfs/txg.c index 6d5123076705..a67c043446f5 100644 --- a/module/zfs/txg.c +++ b/module/zfs/txg.c @@ -6,7 +6,7 @@ * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. + * or https://opensource.org/licenses/CDDL-1.0. * See the License for the specific language governing permissions * and limitations under the License. * @@ -111,7 +111,7 @@ static __attribute__((noreturn)) void txg_sync_thread(void *arg); static __attribute__((noreturn)) void txg_quiesce_thread(void *arg); -int zfs_txg_timeout = 5; /* max seconds worth of delta per txg */ +uint_t zfs_txg_timeout = 5; /* max seconds worth of delta per txg */ /* * Prepare the txg subsystem. @@ -429,7 +429,7 @@ txg_quiesce(dsl_pool_t *dp, uint64_t txg) } static void -txg_do_callbacks(list_t *cb_list) +txg_do_callbacks(void *cb_list) { dmu_tx_do_callbacks(cb_list, 0); @@ -479,7 +479,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) list_move_tail(cb_list, &tc->tc_callbacks[g]); - (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) + (void) taskq_dispatch(tx->tx_commit_cb_taskq, txg_do_callbacks, cb_list, TQ_SLEEP); } } @@ -895,15 +895,10 @@ txg_list_destroy(txg_list_t *tl) boolean_t txg_all_lists_empty(txg_list_t *tl) { - mutex_enter(&tl->tl_lock); - for (int i = 0; i < TXG_SIZE; i++) { - if (!txg_list_empty_impl(tl, i)) { - mutex_exit(&tl->tl_lock); - return (B_FALSE); - } - } - mutex_exit(&tl->tl_lock); - return (B_TRUE); + boolean_t res = B_TRUE; + for (int i = 0; i < TXG_SIZE; i++) + res &= (tl->tl_head[i] == NULL); + return (res); } /* @@ -1069,5 +1064,5 @@ EXPORT_SYMBOL(txg_wait_callbacks); EXPORT_SYMBOL(txg_stalled); EXPORT_SYMBOL(txg_sync_waiting); -ZFS_MODULE_PARAM(zfs_txg, zfs_txg_, timeout, INT, ZMOD_RW, +ZFS_MODULE_PARAM(zfs_txg, zfs_txg_, timeout, UINT, ZMOD_RW, "Max seconds worth of delta per txg"); |