| 2471 | } |
| 2472 | |
| 2473 | static int |
| 2474 | ztest_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 | |
| 2512 | static int |
| 2513 | ztest_write(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size, |
no test coverage detected