Deleted Added
sdiff udiff text old ( 224177 ) new ( 224526 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 191 unchanged lines hidden (view full) ---

200 char od_name[MAXNAMELEN];
201} ztest_od_t;
202
203/*
204 * Per-dataset state.
205 */
206typedef struct ztest_ds {
207 objset_t *zd_os;
208 zilog_t *zd_zilog;
209 uint64_t zd_seq;
210 ztest_od_t *zd_od; /* debugging aid */
211 char zd_name[MAXNAMELEN];
212 mutex_t zd_dirobj_lock;
213 rll_t zd_object_lock[ZTEST_OBJECT_LOCKS];
214 rll_t zd_range_lock[ZTEST_RANGE_LOCKS];
215} ztest_ds_t;

--- 17 unchanged lines hidden (view full) ---

233 */
234ztest_func_t ztest_dmu_read_write;
235ztest_func_t ztest_dmu_write_parallel;
236ztest_func_t ztest_dmu_object_alloc_free;
237ztest_func_t ztest_dmu_commit_callbacks;
238ztest_func_t ztest_zap;
239ztest_func_t ztest_zap_parallel;
240ztest_func_t ztest_zil_commit;
241ztest_func_t ztest_dmu_read_write_zcopy;
242ztest_func_t ztest_dmu_objset_create_destroy;
243ztest_func_t ztest_dmu_prealloc;
244ztest_func_t ztest_fzap;
245ztest_func_t ztest_dmu_snapshot_create_destroy;
246ztest_func_t ztest_dsl_prop_get_set;
247ztest_func_t ztest_spa_prop_get_set;
248ztest_func_t ztest_spa_create_destroy;

--- 19 unchanged lines hidden (view full) ---

268 { ztest_dmu_read_write, 1, &zopt_always },
269 { ztest_dmu_write_parallel, 10, &zopt_always },
270 { ztest_dmu_object_alloc_free, 1, &zopt_always },
271 { ztest_dmu_commit_callbacks, 1, &zopt_always },
272 { ztest_zap, 30, &zopt_always },
273 { ztest_zap_parallel, 100, &zopt_always },
274 { ztest_split_pool, 1, &zopt_always },
275 { ztest_zil_commit, 1, &zopt_incessant },
276 { ztest_dmu_read_write_zcopy, 1, &zopt_often },
277 { ztest_dmu_objset_create_destroy, 1, &zopt_often },
278 { ztest_dsl_prop_get_set, 1, &zopt_often },
279 { ztest_spa_prop_get_set, 1, &zopt_sometimes },
280#if 0
281 { ztest_dmu_prealloc, 1, &zopt_sometimes },
282#endif
283 { ztest_fzap, 1, &zopt_sometimes },

--- 697 unchanged lines hidden (view full) ---

981static void
982ztest_zd_init(ztest_ds_t *zd, objset_t *os)
983{
984 zd->zd_os = os;
985 zd->zd_zilog = dmu_objset_zil(os);
986 zd->zd_seq = 0;
987 dmu_objset_name(os, zd->zd_name);
988
989 VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0);
990
991 for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
992 ztest_rll_init(&zd->zd_object_lock[l]);
993
994 for (int l = 0; l < ZTEST_RANGE_LOCKS; l++)
995 ztest_rll_init(&zd->zd_range_lock[l]);
996}

--- 963 unchanged lines hidden (view full) ---

1960
1961 /*
1962 * Pick an i/o type at random, biased toward writing block tags.
1963 */
1964 io_type = ztest_random(ZTEST_IO_TYPES);
1965 if (ztest_random(2) == 0)
1966 io_type = ZTEST_IO_WRITE_TAG;
1967
1968 switch (io_type) {
1969
1970 case ZTEST_IO_WRITE_TAG:
1971 ztest_bt_generate(&wbt, zd->zd_os, object, offset, 0, 0, 0);
1972 (void) ztest_write(zd, object, offset, sizeof (wbt), &wbt);
1973 break;
1974
1975 case ZTEST_IO_WRITE_PATTERN:

--- 19 unchanged lines hidden (view full) ---

1995 (void) ztest_truncate(zd, object, offset, blocksize);
1996 break;
1997
1998 case ZTEST_IO_SETATTR:
1999 (void) ztest_setattr(zd, object);
2000 break;
2001 }
2002
2003 umem_free(data, blocksize);
2004}
2005
2006/*
2007 * Initialize an object description template.
2008 */
2009static void
2010ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index,

--- 38 unchanged lines hidden (view full) ---

2049}
2050
2051/* ARGSUSED */
2052void
2053ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
2054{
2055 zilog_t *zilog = zd->zd_zilog;
2056
2057 zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
2058
2059 /*
2060 * Remember the committed values in zd, which is in parent/child
2061 * shared memory. If we die, the next iteration of ztest_run()
2062 * will verify that the log really does contain this record.
2063 */
2064 mutex_enter(&zilog->zl_lock);
2065 ASSERT(zd->zd_seq <= zilog->zl_commit_lr_seq);
2066 zd->zd_seq = zilog->zl_commit_lr_seq;
2067 mutex_exit(&zilog->zl_lock);
2068}
2069
2070/*
2071 * Verify that we can't destroy an active pool, create an existing pool,
2072 * or create a pool with a bad vdev spec.
2073 */
2074/* ARGSUSED */
2075void
2076ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
2077{
2078 ztest_shared_t *zs = ztest_shared;

--- 3534 unchanged lines hidden ---