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

Function ztest_dataset_dirobj_verify

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

Source from the content-addressed store, hash-verified

6927}
6928
6929static void
6930ztest_dataset_dirobj_verify(ztest_ds_t *zd)
6931{
6932 uint64_t usedobjs, dirobjs, scratch;
6933
6934 /*
6935 * ZTEST_DIROBJ is the object directory for the entire dataset.
6936 * Therefore, the number of objects in use should equal the
6937 * number of ZTEST_DIROBJ entries, +1 for ZTEST_DIROBJ itself.
6938 * If not, we have an object leak.
6939 *
6940 * Note that we can only check this in ztest_dataset_open(),
6941 * when the open-context and syncing-context values agree.
6942 * That's because zap_count() returns the open-context value,
6943 * while dmu_objset_space() returns the rootbp fill count.
6944 */
6945 VERIFY3U(0, ==, zap_count(zd->zd_os, ZTEST_DIROBJ, &dirobjs));
6946 dmu_objset_space(zd->zd_os, &scratch, &scratch, &usedobjs, &scratch);
6947 ASSERT3U(dirobjs + 1, ==, usedobjs);
6948}
6949
6950static int
6951ztest_dataset_open(int d)

Callers 1

ztest_dataset_openFunction · 0.85

Calls 2

zap_countFunction · 0.85
dmu_objset_spaceFunction · 0.85

Tested by

no test coverage detected