zd->zd_zilog = dmu_objset_zil(os);
zd->zd_seq = 0;
dmu_objset_name(os, zd->zd_name);
+ int l;
- VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0);
+ mutex_init(&zd->zd_dirobj_lock, NULL, MUTEX_DEFAULT, NULL);
- for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
+ for (l = 0; l < ZTEST_OBJECT_LOCKS; l++)
ztest_rll_init(&zd->zd_object_lock[l]);
- for (int l = 0; l < ZTEST_RANGE_LOCKS; l++)
+ for (l = 0; l < ZTEST_RANGE_LOCKS; l++)
ztest_rll_init(&zd->zd_range_lock[l]);
}
static void
ztest_zd_fini(ztest_ds_t *zd)
{
- VERIFY(_mutex_destroy(&zd->zd_dirobj_lock) == 0);
+ int l;
+
+ mutex_destroy(&zd->zd_dirobj_lock);
- for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
+ for (l = 0; l < ZTEST_OBJECT_LOCKS; l++)
ztest_rll_destroy(&zd->zd_object_lock[l]);
- for (int l = 0; l < ZTEST_RANGE_LOCKS; l++)
+ for (l = 0; l < ZTEST_RANGE_LOCKS; l++)
ztest_rll_destroy(&zd->zd_range_lock[l]);
}
{
int missing = 0;
int error;
+ int i;
- ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+ ASSERT(mutex_held(&zd->zd_dirobj_lock));
- for (int i = 0; i < count; i++, od++) {
+ for (i = 0; i < count; i++, od++) {
od->od_object = 0;
error = zap_lookup(zd->zd_os, od->od_dir, od->od_name,
sizeof (uint64_t), 1, &od->od_object);
ztest_create(ztest_ds_t *zd, ztest_od_t *od, int count)
{
int missing = 0;
+ int i;
- ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+ ASSERT(mutex_held(&zd->zd_dirobj_lock));
- for (int i = 0; i < count; i++, od++) {
+ for (i = 0; i < count; i++, od++) {
if (missing) {
od->od_object = 0;
missing++;
{
int missing = 0;
int error;
+ int i;
- ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+ ASSERT(mutex_held(&zd->zd_dirobj_lock));
od += count - 1;
objset_t *os, *os2;
char name[MAXNAMELEN];
zilog_t *zilog;
+ int i;
- (void) rw_rdlock(&zs->zs_name_lock);
+ (void) rw_enter(&zs->zs_name_lock, RW_READER);
(void) snprintf(name, MAXNAMELEN, "%s/temp_%llu",
zs->zs_pool, (u_longlong_t)id);
ZFS_PROP_DEDUP
};
ztest_shared_t *zs = ztest_shared;
+ int p;
- (void) rw_rdlock(&zs->zs_name_lock);
+ (void) rw_enter(&zs->zs_name_lock, RW_READER);
- for (int p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
+ for (p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
(void) ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
static void
ztest_run(ztest_shared_t *zs)
{
- thread_t *tid;
+ kthread_t **tid;
spa_t *spa;
- thread_t resume_tid;
+ kthread_t *resume_thread;
+ uint64_t object;
int error;
+ int t, d;
ztest_exiting = B_FALSE;
/*
* Kick off all the tests that run in parallel.
*/
- for (int t = 0; t < zopt_threads; t++) {
+ for (t = 0; t < zopt_threads; t++) {
if (t < zopt_datasets && ztest_dataset_open(zs, t) != 0)
return;
- VERIFY(thr_create(0, 0, ztest_thread, (void *)(uintptr_t)t,
- THR_BOUND, &tid[t]) == 0);
+
+ VERIFY3P(tid[t] = thread_create(NULL, 0, ztest_thread,
+ (void *)(uintptr_t)t, TS_RUN, NULL, 0, 0), !=, NULL);
}
/*
* Wait for all of the tests to complete. We go in reverse order
* so we don't close datasets while threads are still using them.
*/
- for (int t = zopt_threads - 1; t >= 0; t--) {
+ for (t = zopt_threads - 1; t >= 0; t--) {
- VERIFY(thr_join(tid[t], NULL, NULL) == 0);
+ thread_join(tid[t]->t_tid);
if (t < zopt_datasets)
ztest_dataset_close(zs, t);
}