From 882ec504ea85b34b1ceffbd41db286e63b3779e4 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 21 Jun 2010 21:24:54 -0700 Subject: [PATCH] Minor ztest fixes Move create/destroy function to correct places. I'm not sure why this wasn't caught upstream it should have been, regardless let's just fix it here. Personally I find it handy to be able to enable full debugging in zfs with the 'debug=' command line option so I'm enabled that as well. --- cmd/ztest/ztest.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index eb31139f27..7bfa1ce55b 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -5274,6 +5274,11 @@ ztest_run(ztest_shared_t *zs) } kernel_fini(); + + list_destroy(&zcl.zcl_callbacks); + mutex_destroy(&zcl.zcl_callbacks_lock); + rw_destroy(&zs->zs_name_lock); + mutex_destroy(&zs->zs_vdev_lock); } static void @@ -5344,12 +5349,8 @@ ztest_freeze(ztest_shared_t *zs) spa_close(spa, FTAG); kernel_fini(); - list_destroy(&zcl.zcl_callbacks); - - (void) mutex_destroy(&zcl.zcl_callbacks_lock); - - (void) rw_destroy(&zs->zs_name_lock); - (void) mutex_destroy(&zs->zs_vdev_lock); + rw_destroy(&zs->zs_name_lock); + mutex_destroy(&zs->zs_vdev_lock); } void @@ -5452,6 +5453,7 @@ main(int argc, char **argv) ztest_random_fd = open("/dev/urandom", O_RDONLY); + dprintf_setup(&argc, argv); process_options(argc, argv); /* Override location of zpool.cache */