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

Function ztest_remove

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

Source from the content-addressed store, hash-verified

2471}
2472
2473static int
2474ztest_remove(ztest_ds_t *zd, ztest_od_t *od, int count)
2475{
2476 int missing = 0;
2477 int error;
2478 int i;
2479
2480 ASSERT(MUTEX_HELD(&zd->zd_dirobj_lock));
2481
2482 od += count - 1;
2483
2484 for (i = count - 1; i >= 0; i--, od--) {
2485 if (missing) {
2486 missing++;
2487 continue;
2488 }
2489
2490 /*
2491 * No object was found.
2492 */
2493 if (od->od_object == 0)
2494 continue;
2495
2496 lr_remove_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name);
2497
2498 lr->lr_doid = od->od_dir;
2499
2500 if ((error = ztest_replay_remove(zd, lr, B_FALSE)) != 0) {
2501 ASSERT3U(error, ==, ENOSPC);
2502 missing++;
2503 } else {
2504 od->od_object = 0;
2505 }
2506 ztest_lr_free(lr, sizeof (*lr), od->od_name);
2507 }
2508
2509 return (missing);
2510}
2511
2512static int
2513ztest_write(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size,

Callers 1

ztest_object_initFunction · 0.85

Calls 3

ztest_lr_allocFunction · 0.85
ztest_replay_removeFunction · 0.85
ztest_lr_freeFunction · 0.85

Tested by

no test coverage detected