From 63fce783d6938be24ab9f7d23381920c0b74b48e Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 27 May 2010 14:23:51 -0700
Subject: [PATCH 1/2] Readd feature-branch to get the last of the reversions

---
 .topdeps | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.topdeps b/.topdeps
index ff8849266b..607c231780 100644
--- a/.topdeps
+++ b/.topdeps
@@ -1,2 +1,3 @@
 gcc-branch
 fix-branch
+feature-branch

From 390995db28fe9e635000e4e1ae9d9c1678b3eab4 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Thu, 27 May 2010 14:25:06 -0700
Subject: [PATCH 2/2] Revert all remaining changes.

---
 cmd/ztest/ztest.c                      | 15 +++------------
 lib/libzpool/include/sys/zfs_context.h |  2 +-
 lib/libzpool/taskq.c                   |  5 +++--
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index c153ca6b17..5f49fd5a06 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -58,9 +58,6 @@
  *     the transaction group number is less than the current, open txg.
  *     If you add a new test, please do this if applicable.
  *
- * (7) Threads are created with a reduced stack size, for sanity checking.
- *     Therefore, it's important not to allocate huge buffers on the stack.
- *
  * When run with no arguments, ztest runs for about five minutes and
  * produces no output if successful.  To get a little bit of information,
  * specify -V.  To get more information, specify -VV, and so on.
@@ -159,7 +156,6 @@ typedef struct ztest_args {
 	ztest_block_tag_t za_wbt;
 	dmu_object_info_t za_doi;
 	dmu_buf_t	*za_dbuf;
-	boolean_t	za_exited;
 } ztest_args_t;
 
 typedef void ztest_func_t(ztest_args_t *);
@@ -254,7 +250,6 @@ static int ztest_dump_core = 1;
 
 static uint64_t metaslab_sz;
 static boolean_t ztest_exiting;
-static boolean_t resume_thr_exited;
 
 extern uint64_t metaslab_gang_bang;
 extern uint64_t metaslab_df_alloc_threshold;
@@ -2549,7 +2544,7 @@ ztest_dmu_write_parallel(ztest_args_t *za)
 	uint64_t off, txg, txg_how;
 	mutex_t *lp;
 	char osname[MAXNAMELEN];
-	char *iobuf;
+	char iobuf[SPA_MAXBLOCKSIZE];
 	blkptr_t blk = { 0 };
 	uint64_t blkoff;
 	zbookmark_t zb;
@@ -2718,8 +2713,6 @@ ztest_dmu_write_parallel(ztest_args_t *za)
 	ASSERT3U(BP_GET_LEVEL(&blk), ==, 0);
 	ASSERT3U(BP_GET_LSIZE(&blk), ==, bs);
 
-	iobuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
-
 	/*
 	 * Read the block that dmu_sync() returned to make sure its contents
 	 * match what we wrote.  We do this while still txg_suspend()ed
@@ -2738,10 +2731,10 @@ ztest_dmu_write_parallel(ztest_args_t *za)
 	bcopy(&iobuf[blkoff], rbt, btsize);
 
 	if (rbt->bt_objset == 0)		/* concurrent free */
-		goto out;
+		return;
 
 	if (wbt->bt_objset == 0)		/* all-zero overwrite */
-		goto out;
+		return;
 
 	ASSERT3U(rbt->bt_objset, ==, wbt->bt_objset);
 	ASSERT3U(rbt->bt_object, ==, wbt->bt_object);
@@ -2757,8 +2750,6 @@ ztest_dmu_write_parallel(ztest_args_t *za)
 		ASSERT3U(rbt->bt_seq, ==, wbt->bt_seq);
 	else
 		ASSERT3U(rbt->bt_seq, >, wbt->bt_seq);
-out:
-	umem_free(iobuf, SPA_MAXBLOCKSIZE);
 }
 
 /*
diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h
index 327f817856..230c233a24 100644
--- a/lib/libzpool/include/sys/zfs_context.h
+++ b/lib/libzpool/include/sys/zfs_context.h
@@ -330,7 +330,7 @@ extern taskq_t	*taskq_create(const char *, int, pri_t, int, int, uint_t);
 extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
 extern void	taskq_destroy(taskq_t *);
 extern void	taskq_wait(taskq_t *);
-extern int	taskq_member(taskq_t *, kthread_t *);
+extern int	taskq_member(taskq_t *, void *);
 extern void	system_taskq_init(void);
 
 #define	XVA_MAPSIZE	3
diff --git a/lib/libzpool/taskq.c b/lib/libzpool/taskq.c
index 70b720ed8e..1a73fe83cc 100644
--- a/lib/libzpool/taskq.c
+++ b/lib/libzpool/taskq.c
@@ -134,7 +134,7 @@ taskq_wait(taskq_t *tq)
 	mutex_exit(&tq->tq_lock);
 }
 
-static void
+static void *
 taskq_thread(void *arg)
 {
 	taskq_t *tq = arg;
@@ -217,6 +217,7 @@ taskq_create(const char *name, int nthreads, pri_t pri,
 void
 taskq_destroy(taskq_t *tq)
 {
+	int t;
 	int nthreads = tq->tq_nthreads;
 
 	taskq_wait(tq);
@@ -251,7 +252,7 @@ taskq_destroy(taskq_t *tq)
 }
 
 int
-taskq_member(taskq_t *tq, kthread_t *t)
+taskq_member(taskq_t *tq, void *t)
 {
 	int i;