From: Brian Behlendorf Date: Mon, 14 Jun 2010 23:24:45 +0000 (-0700) Subject: Merge branch 'fix-branch' into refs/top-bases/zfs-branch X-Git-Tag: zfs-0.5.0~38^2^2~1^2^2~28^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb894076a4855d76a4eca36901b845df78f81adf;p=zfs Merge branch 'fix-branch' into refs/top-bases/zfs-branch Conflicts: cmd/ztest/ztest.c --- eb894076a4855d76a4eca36901b845df78f81adf diff --cc cmd/ztest/ztest.c index 97211e01e,69086a34a..83ca0df83 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@@ -979,28 -982,25 +982,28 @@@ ztest_zd_init(ztest_ds_t *zd, objset_t 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) { + int l; + - VERIFY(_mutex_destroy(&zd->zd_dirobj_lock) == 0); + 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]); } @@@ -1731,11 -1731,10 +1734,11 @@@ ztest_lookup(ztest_ds_t *zd, ztest_od_ { 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); @@@ -1772,11 -1771,10 +1775,11 @@@ static in 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++; @@@ -1818,9 -1816,8 +1821,9 @@@ ztest_remove(ztest_ds_t *zd, ztest_od_ { int missing = 0; int error; + int i; - ASSERT(_mutex_held(&zd->zd_dirobj_lock)); + ASSERT(mutex_held(&zd->zd_dirobj_lock)); od += count - 1; @@@ -2922,9 -2914,8 +2925,9 @@@ ztest_dmu_objset_create_destroy(ztest_d 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); @@@ -4261,11 -4241,10 +4265,11 @@@ ztest_dsl_prop_get_set(ztest_ds_t *zd, 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)); @@@ -5123,11 -5106,11 +5134,12 @@@ ztest_dataset_close(ztest_shared_t *zs 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; @@@ -5212,19 -5195,20 +5224,20 @@@ /* * 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); }