/* returns TRUE if someone is waiting for the next txg to sync */
extern boolean_t txg_sync_waiting(struct dsl_pool *dp);
+/*
+ * Wait for pending commit callbacks of already-synced transactions to finish
+ * processing.
+ */
+extern void txg_wait_callbacks(struct dsl_pool *dp);
+
/*
* Per-txg object lists.
*/
EXPORT_SYMBOL(dmu_objset_snapshot);
EXPORT_SYMBOL(dmu_objset_stats);
EXPORT_SYMBOL(dmu_objset_fast_stat);
+EXPORT_SYMBOL(dmu_objset_spa);
EXPORT_SYMBOL(dmu_objset_space);
EXPORT_SYMBOL(dmu_objset_fsid_guid);
EXPORT_SYMBOL(dmu_objset_find);
}
}
+/*
+ * Wait for pending commit callbacks of already-synced transactions to finish
+ * processing.
+ * Calling this function from within a commit callback will deadlock.
+ */
+void
+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);
+}
+
static void
txg_sync_thread(dsl_pool_t *dp)
{
EXPORT_SYMBOL(txg_delay);
EXPORT_SYMBOL(txg_wait_synced);
EXPORT_SYMBOL(txg_wait_open);
+EXPORT_SYMBOL(txg_wait_callbacks);
EXPORT_SYMBOL(txg_stalled);
EXPORT_SYMBOL(txg_sync_waiting);
#endif