mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add API to wait for pending commit callbacks
This adds an API to wait for pending commit callbacks of already-synced transactions to finish processing. This is needed by the DMU-OSD in Lustre during device finalization when some callbacks may still not be called, this leads to non-zero reference count errors. See lustre.org bug 23931.
This commit is contained in:
committed by
Brian Behlendorf
parent
8d4e8140ef
commit
54a179e7b8
@@ -1813,6 +1813,7 @@ EXPORT_SYMBOL(dmu_objset_destroy);
|
||||
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);
|
||||
|
||||
@@ -350,6 +350,20 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
@@ -735,6 +749,7 @@ EXPORT_SYMBOL(txg_register_callbacks);
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user