Skip to content

Commit ae93aeb

Browse files
authored
Add warning for external consumers of dmu_tx_callback_register
While reading some code @grwilson came across the above function that seemingly had no consumers besides a ztest callback that ensures that the tx_callback infrastructure works correctly. It turns out that Lustre is the main (and potentially the only) consumer of this. Refer to `osd_trans_commit_cb` of `lustre/osd-zfs/osd_handler.c` in the Lustre repo for more info. Let's add a comment highlighting this before someone removes it by mistake. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Serapheim Dimitropoulos <[email protected]> Closes #16698
1 parent 6187b19 commit ae93aeb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

module/zfs/dmu_tx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,13 @@ dmu_tx_pool(dmu_tx_t *tx)
13771377
return (tx->tx_pool);
13781378
}
13791379

1380+
/*
1381+
* Register a callback to be executed at the end of a TXG.
1382+
*
1383+
* Note: This currently exists for outside consumers, specifically the ZFS OSD
1384+
* for Lustre. Please do not remove before checking that project. For examples
1385+
* on how to use this see `ztest_commit_callback`.
1386+
*/
13801387
void
13811388
dmu_tx_callback_register(dmu_tx_t *tx, dmu_tx_callback_func_t *func, void *data)
13821389
{

0 commit comments

Comments
 (0)