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

Function ztest_prealloc

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

Source from the content-addressed store, hash-verified

2572}
2573
2574static void
2575ztest_prealloc(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)
2576{
2577 objset_t *os = zd->zd_os;
2578 dmu_tx_t *tx;
2579 uint64_t txg;
2580 rl_t *rl;
2581
2582 txg_wait_synced(dmu_objset_pool(os), 0);
2583
2584 ztest_object_lock(zd, object, RL_READER);
2585 rl = ztest_range_lock(zd, object, offset, size, RL_WRITER);
2586
2587 tx = dmu_tx_create(os);
2588
2589 dmu_tx_hold_write(tx, object, offset, size);
2590
2591 txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
2592
2593 if (txg != 0) {
2594 dmu_prealloc(os, object, offset, size, tx);
2595 dmu_tx_commit(tx);
2596 txg_wait_synced(dmu_objset_pool(os), txg);
2597 } else {
2598 (void) dmu_free_long_range(os, object, offset, size);
2599 }
2600
2601 ztest_range_unlock(rl);
2602 ztest_object_unlock(zd, object);
2603}
2604
2605static void
2606ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)

Callers 1

ztest_dmu_preallocFunction · 0.85

Calls 12

txg_wait_syncedFunction · 0.85
dmu_objset_poolFunction · 0.85
ztest_object_lockFunction · 0.85
ztest_range_lockFunction · 0.85
dmu_tx_createFunction · 0.85
dmu_tx_hold_writeFunction · 0.85
ztest_tx_assignFunction · 0.85
dmu_preallocFunction · 0.85
dmu_tx_commitFunction · 0.85
dmu_free_long_rangeFunction · 0.85
ztest_range_unlockFunction · 0.85
ztest_object_unlockFunction · 0.85

Tested by

no test coverage detected