MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ztest_tx_assign

Function ztest_tx_assign

freebsd/contrib/openzfs/cmd/ztest/ztest.c:1616–1640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1614#define TXG_MIGHTWAIT (ztest_random(10) == 0 ? TXG_NOWAIT : TXG_WAIT)
1615
1616static uint64_t
1617ztest_tx_assign(dmu_tx_t *tx, uint64_t txg_how, const char *tag)
1618{
1619 uint64_t txg;
1620 int error;
1621
1622 /*
1623 * Attempt to assign tx to some transaction group.
1624 */
1625 error = dmu_tx_assign(tx, txg_how);
1626 if (error) {
1627 if (error == ERESTART) {
1628 ASSERT(txg_how == TXG_NOWAIT);
1629 dmu_tx_wait(tx);
1630 } else {
1631 ASSERT3U(error, ==, ENOSPC);
1632 ztest_record_enospc(tag);
1633 }
1634 dmu_tx_abort(tx);
1635 return (0);
1636 }
1637 txg = dmu_tx_get_txg(tx);
1638 ASSERT(txg != 0);
1639 return (txg);
1640}
1641
1642static void
1643ztest_bt_generate(ztest_block_tag_t *bt, objset_t *os, uint64_t object,

Callers 11

ztest_replay_createFunction · 0.85
ztest_replay_removeFunction · 0.85
ztest_replay_writeFunction · 0.85
ztest_replay_truncateFunction · 0.85
ztest_replay_setattrFunction · 0.85
ztest_preallocFunction · 0.85
ztest_dmu_read_writeFunction · 0.85
ztest_zapFunction · 0.85
ztest_fzapFunction · 0.85
ztest_zap_parallelFunction · 0.85

Calls 5

dmu_tx_assignFunction · 0.85
dmu_tx_waitFunction · 0.85
ztest_record_enospcFunction · 0.85
dmu_tx_abortFunction · 0.85
dmu_tx_get_txgFunction · 0.85

Tested by

no test coverage detected