From 6a394806f5a393e1aca968f5f4aaaf0d45ba232f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 16:18:07 -0800 Subject: [PATCH 1/4] Prototype fixes --- cmd/ztest/ztest.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 53cc6c7093..611b900533 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -260,7 +260,7 @@ static void usage(boolean_t) __NORETURN; * debugging facilities. */ const char * -_umem_debug_init() +_umem_debug_init(void) { return ("default,verbose"); /* $UMEM_DEBUG setting */ } @@ -763,19 +763,19 @@ ztest_replay_remove(ztest_replay_t *zr, lr_remove_t *lr, boolean_t byteswap) } zil_replay_func_t *ztest_replay_vector[TX_MAX_TYPE] = { - NULL, /* 0 no such transaction type */ - ztest_replay_create, /* TX_CREATE */ - NULL, /* TX_MKDIR */ - NULL, /* TX_MKXATTR */ - NULL, /* TX_SYMLINK */ - ztest_replay_remove, /* TX_REMOVE */ - NULL, /* TX_RMDIR */ - NULL, /* TX_LINK */ - NULL, /* TX_RENAME */ - NULL, /* TX_WRITE */ - NULL, /* TX_TRUNCATE */ - NULL, /* TX_SETATTR */ - NULL, /* TX_ACL */ + NULL, /* 0 no such transaction type */ + (zil_replay_func_t)ztest_replay_create, /* TX_CREATE */ + NULL, /* TX_MKDIR */ + NULL, /* TX_MKXATTR */ + NULL, /* TX_SYMLINK */ + (zil_replay_func_t)ztest_replay_remove, /* TX_REMOVE */ + NULL, /* TX_RMDIR */ + NULL, /* TX_LINK */ + NULL, /* TX_RENAME */ + NULL, /* TX_WRITE */ + NULL, /* TX_TRUNCATE */ + NULL, /* TX_SETATTR */ + NULL, /* TX_ACL */ }; /* From bb128e51e6afb8f50dc0faa0c16d59d5de5d5a3a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 16:20:36 -0800 Subject: [PATCH 2/4] Use thread so we can add other goodies beyond simply the pthread base --- lib/libzpool/include/sys/zfs_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h index d9be1eb293..84ed428a9e 100644 --- a/lib/libzpool/include/sys/zfs_context.h +++ b/lib/libzpool/include/sys/zfs_context.h @@ -50,7 +50,7 @@ extern "C" { #include #include #include -#include +#include #include #include #include From 50735743b7ed64dff2c50509aef8a5783a944eda Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 16:22:28 -0800 Subject: [PATCH 3/4] Err undo that --- lib/libzpool/include/sys/zfs_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h index 84ed428a9e..d9be1eb293 100644 --- a/lib/libzpool/include/sys/zfs_context.h +++ b/lib/libzpool/include/sys/zfs_context.h @@ -50,7 +50,7 @@ extern "C" { #include #include #include -#include +#include #include #include #include From dee065ca8dc389453957c9f42be260f7cbcff73b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 16:26:23 -0800 Subject: [PATCH 4/4] Use pthread versions --- cmd/ztest/ztest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 4aba991260..750ca2a8c7 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -986,7 +986,7 @@ ztest_vdev_attach_detach(ztest_args_t *za) int oldvd_is_log; int error, expected_error; - (void) mutex_lock(&ztest_shared->zs_vdev_lock); + (void) pthread_mutex_lock(&ztest_shared->zs_vdev_lock); spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER); @@ -1039,7 +1039,7 @@ ztest_vdev_attach_detach(ztest_args_t *za) if (error != 0 && error != ENODEV && error != EBUSY) fatal(0, "detach (%s) returned %d", oldpath, error); - (void) mutex_unlock(&ztest_shared->zs_vdev_lock); + (void) pthread_mutex_unlock(&ztest_shared->zs_vdev_lock); return; }