Skip to content

Commit

Permalink
Add warning for external consumers of dmu_tx_callback_register
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Serapheim Dimitropoulos <[email protected]>
  • Loading branch information
sdimitro committed Oct 29, 2024
1 parent e5d1f68 commit 3676770
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,13 @@ dmu_tx_pool(dmu_tx_t *tx)
return (tx->tx_pool);
}

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

0 comments on commit 3676770

Please sign in to comment.