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

Function ztest_zil_commit

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

ARGSUSED */

Source from the content-addressed store, hash-verified

2736
2737/* ARGSUSED */
2738void
2739ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
2740{
2741 zilog_t *zilog = zd->zd_zilog;
2742
2743 (void) pthread_rwlock_rdlock(&zd->zd_zilog_lock);
2744
2745 zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
2746
2747 /*
2748 * Remember the committed values in zd, which is in parent/child
2749 * shared memory. If we die, the next iteration of ztest_run()
2750 * will verify that the log really does contain this record.
2751 */
2752 mutex_enter(&zilog->zl_lock);
2753 ASSERT(zd->zd_shared != NULL);
2754 ASSERT3U(zd->zd_shared->zd_seq, <=, zilog->zl_commit_lr_seq);
2755 zd->zd_shared->zd_seq = zilog->zl_commit_lr_seq;
2756 mutex_exit(&zilog->zl_lock);
2757
2758 (void) pthread_rwlock_unlock(&zd->zd_zilog_lock);
2759}
2760
2761/*
2762 * This function is designed to simulate the operations that occur during a

Callers

nothing calls this directly

Calls 4

zil_commitFunction · 0.85
ztest_randomFunction · 0.85
mutex_enterFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected